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.

eZ debug

Timing: Jan 19 2025 03:18:52
Script start
Timing: Jan 19 2025 03:18:52
Module start 'layout'
Timing: Jan 19 2025 03:18:52
Module start 'content'
Timing: Jan 19 2025 03:18:54
Module end 'content'
Timing: Jan 19 2025 03:18:54
Script end

Main resources:

Total runtime1.5563 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 590.3906152.6250
Module start 'layout' 0.00670.0039 743.015639.4453
Module start 'content' 0.01061.5442 782.4609531.2891
Module end 'content' 1.55480.0015 1,313.750012.1563
Script end 1.5563  1,325.9063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.2246160.0002
Check MTime0.00130.0853160.0001
Mysql Total
Database connection0.00090.059210.0009
Mysqli_queries1.507496.8533570.0264
Looping result0.00060.0358550.0000
Template Total1.519697.620.7598
Template load0.00180.115820.0009
Template processing1.517897.521620.7589
Template load and register function0.00030.017710.0003
states
state_id_array0.00090.057010.0009
state_identifier_array0.00130.083420.0006
Override
Cache load0.00150.0941160.0001
Sytem overhead
Fetch class attribute can translate value0.00150.095420.0007
Fetch class attribute name0.00210.136940.0005
XML
Image XML parsing0.00070.042720.0003
class_abstraction
Instantiating content class attribute0.00000.000640.0000
General
dbfile0.00180.1158160.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs