Forums / Developer / [solved] content/action : button to remove an object

[solved] content/action : button to remove an object

Author Message

Antoine W.

Tuesday 02 August 2005 9:56:26 am

Hi !
It's possible to create or edit objects with forms and specific buttons :

<form method="post" action={"content/action/"|ezurl}>
<input type="hidden" name="ContentObjectID" value="{$node.object.id}" />
<input class="button" type="submit" name="EditButton" value="Edit this object" />

Is it possible to remove an object with a form like this ? I've tried with "DelButton" or "RemoveButton"... but had no success.

Paul Borgermans

Tuesday 02 August 2005 10:44:58 am

Hi

Try this:

<form method="post" action={"content/action"|ezurl}>
<input type="hidden" name="ContentNodeID" value="{$node.object.main_node_id}" />
 <input type="hidden" name="ContentObjectID" value="{$node.object.id}" />
    <input type="image" name="ActionRemove" src={"small/edittrash.gif"|ezimage} />
</form>

If you do not have an icon, you can use a button of course

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Antoine W.

Thursday 04 August 2005 7:26:36 am

Thanks Paul, this code works fine :)