Forums / Setup & design / How to remove a location using an html form ?

How to remove a location using an html form ?

Author Message

Sébastien Antoniotti

Thursday 21 December 2006 7:36:22 am

Hi,

In my tempalte I fetch some nodes to display them, and usually when I want to permit front admins to delete the object and the node, I insert this in the display loop :

{if $node.object.can_remove}
<form method="post" action={"/content/action"|ezurl}>
<input type="hidden" name="ContentNodeID" value="{$a.object.main_node_id}" />
<input type="hidden" name="ContentObjectID" value="{$a.object.id}" />
<input class="button" type="submit" name="ActionRemove" value="{'Remove'|i18n('design/standard/node/view')}" />
</form>
{/if}

This code removes the current node and the object.

But now I just want to remove the node because in some case, my object is published in 2 locations (2 nodes), and I just want to remove the "secondary" node.

/article about ez (nodeID : 1) => objectID : 1
/folder1/article about ez (nodeID : 2) => objectID : 1

So, when fetching articles into folder1, I want to display a button who allow user to remove the nodeID 2.

Thanks !

eZ Publish Freelance
web : http://www.webaxis.fr