简体   繁体   中英

How to copy all subcategories to another category

I'm working with MODX Evolution 1.0.14. I need to copy few subcategories to another category, how should I do this?

I need to copy those pages (blue line) to this place (blue dot).

I think this is possible just with some custom php-script which will select all pages I need and insert it with another parent value.

In MODX Evolution, the fastest way is to run a SQL query directly in phpmyadmin. The code below is for Revolution, but with some minor changes it will work for Evo. I don't know the name of the site_content table in Evo.

UPDATE `modx_site_content` SET  `parent` = 765 WHERE `parent` = 1

You can build in some extra security so that only resources with a certain template are changed:

UPDATE `modxt_site_content` SET  `parent` = 765 WHERE `parent` = 1 AND `template` = 5

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM