Forums / Setup & design / How do I change object's location?

How do I change object's location?

Author Message

Aleksandar Adam

Tuesday 27 March 2007 1:24:27 am

Hello,

I would like to know how to change object location i structure tree; in the ohter words:

I would like to move <b>object X</b> from <b>folder A</b> to <b>folder B</b>

and that should be done in the template, not from the admin interface as guys below thougt.

In the other words I would like to do it programatically. When I click a button on my webpage the object moves from one folder to another.

Thanks in advance
Aleksandar

Sylvain Bannier

Tuesday 27 March 2007 4:49:55 am

Hello,

By object, you probably mean "content node" ?

http://www.smile.fr

Softriva .com

Tuesday 27 March 2007 9:40:07 pm

Click on Folder A
Scroll down to see a list of all items in Forlder A

Then you will see three icons to right of each item which are

Edit (Pencil Icon)
Move to another loc (arrow pointed to a folder)
make another copy of the same item (doc)

Click on Move to another loc Then it easy from there

If you don't see the three icons make sure you click on detailed on the top of the list.

I hope I did not confuse you.

Aleksandar Adam

Tuesday 27 March 2007 11:57:32 pm

This was missunderstadning, sorry I wrote wrong,

I would like to move object X from one folder A to folder B which I would control by the template code.

Or in the other words to have template which has abitility to move objects in structure tree programatically - for example I click a button on my webpage and then object X goes from folder A to folder B.

How do I proceed?

Sylvain Bannier

Wednesday 28 March 2007 2:46:15 am

Hello,

You're not supposed to do such a task in template code. This kind of action should be performed in modules or cron jobs.

The following code should open the browser to move the node 12345 :

<form action={'/content/action'|ezurl} method="post">
<input type="hidden" value="12345" name="ContentNodeID"/>
<input class="button" type="submit" value="Move" name="MoveNodeButton"/>
</form>

@see http://ez.no/download/ez_publish/changelogs/ez_publish_3_5/add_move_operation_for_nodes_in_navigation_mode

http://www.smile.fr

Aleksandar Adam

Wednesday 28 March 2007 10:33:08 am

Thanks for your answer. :=)

There two more questions:

1. If you know if there is some simple piece (understandable for beginner) of php code which moves an object from one folder to another?

2. some good reading about: modules, cronjobs and workflows. (best with some practical examples)

best regards
Aleksandar

Kristof Coomans

Wednesday 28 March 2007 11:16:13 am

Hi Aleksander

1) http://ezpedia.org/wiki/en/ez/moving_a_node

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org