Template code for removing objects

Author Message

GDA AS

Tuesday 25 April 2006 12:22:43 am

I'm trying to make a template that will let me remove a object. The object_id is passed to the template in a url parameter called id.

I have tried the following code, but nothing really happens when i click the button. It just redirects me to the home page and the object has not been removed.

<form name="form1" method="post" action={"content/action"|ezurl}>
<input type="hidden" name="ContentObjectID" value="{$view_parameters.id}" />
<input type="submit" name="RemoveButton" value="{'Remove'|i18n('design/standard/node/view')}" />
</form>

Am I missing something in the code?

Kristian Hole

Tuesday 25 April 2006 5:31:30 am

Yes, you are missing the nodeid. Take a look here:

http://ez.no/products/ez_publish/documentation/customization/tips_tricks/editing_creating_and_removing_content_from_the_user_page

Kristian

http://ez.no/ez_publish/documenta...tricks/show_which_templates_are_used
http://ez.no/doc/ez_publish/techn...te_operators/miscellaneous/attribute

GDA AS

Tuesday 25 April 2006 5:59:30 am

Thank you.

So in essence I just nedd to add the ContentNodeID input element to make my form work.

Something like this:

<form name="form1" method="post" action={"content/action"|ezurl}>
<input type="hidden" name="ContentObjectID" value="{$view_parameters.oid}" />
<input type="hidden" name="ContentNodeID" value="{$view_parameters.nid}" />
<input type="submit" name="RemoveButton" value="{'Remove'|i18n('design/standard/node/view')}" />
</form>

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.