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

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 31 2025 07:26:35
Script start
Timing: Jan 31 2025 07:26:35
Module start 'layout'
Timing: Jan 31 2025 07:26:35
Module start 'content'
Timing: Jan 31 2025 07:26:35
Module end 'content'
Timing: Jan 31 2025 07:26:35
Script end

Main resources:

Total runtime0.0177 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 588.2656151.2266
Module start 'layout' 0.00520.0024 739.492236.6797
Module start 'content' 0.00760.0083 776.171990.3125
Module end 'content' 0.01590.0018 866.484429.9922
Script end 0.0177  896.4766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002614.4054140.0002
Check MTime0.00116.4088140.0001
Mysql Total
Database connection0.00084.280610.0008
Mysqli_queries0.002313.024730.0008
Looping result0.00000.090110.0000
Template Total0.00126.610.0012
Template load0.00084.522610.0008
Template processing0.00042.035410.0004
Override
Cache load0.00052.717110.0005
General
dbfile0.003318.860780.0004
String conversion0.00000.033640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs