This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » General » Changing content layout, having some...

Changing content layout, having some trouble

Changing content layout, having some trouble

Monday 22 September 2008 3:35:56 pm - 6 replies

I'm changing my content structure, and most imnportantly, I'm changing main node for alot of nodes. This is a manual job, and that's fine.

I have articles with comments as children nodes. My problem is that when I switch main node for an article, all the comments belong to the article node in the "old" main position. Is there anyway I can automate, or atleast script, the following?

- Loop all article objects
- For each article, check all nodes (locations)
- Move any child nodes of articles to the article object main node

Sorry if it's unclear. I really don't want to do this manually, especially since I cannot move more than one node at a time...

Monday 22 September 2008 3:49:23 pm

Why do you move them by using node location?

Monday 22 September 2008 9:45:53 pm

Why would you change main node of an object a lot, especially if contains lots of child nodes?

Anyways, it seems to me that this should be definitely achievable with eZ API, the logic seems quite straightforward, and it could be in form of a cronjob or an action for which an extra button would be added in the admin interface. You would have to consider performance issues, though. Unless it is a couple of comments per thread, this could be quite an exhaustive operation, especially as a cronjob.

Tuesday 23 September 2008 12:06:25 am

not exactly a magic solution, but at least there is an extension that adds a "move all selected nodes" button in the admin interface, right next to the "delete selected nodes".
It goes a long way in making such tasks easier

Tuesday 23 September 2008 12:08:10 am

ps: as André pointed out, if you use "move", by default all children will follow. Can you use that functionality instead of swapping node location of the container object itself?

Tuesday 23 September 2008 1:14:35 pm

Cool, I'll check out the extension, it will help alot.

The reason I'm doing this through locations is that all the articles already have what will be the new main location as a secondary location. I'm moving from having nodes primarily positioned on dates and secondary on tags to the other way around. Since the nodes already have the locations, this is alot simpler to do.

Tuesday 23 September 2008 2:45:44 pm

This extension makes this doable:

Thanks alot for that! I can't for the life of me understand why there isn't such functionality in eZP already, I've longed for it many a time before happy.gif Emoticon Or a dropdown with actions, like in Gmail.


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from