Forums / Setup & design / Template code for removing objects

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

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>