[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 :)

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 20 2025 10:58:55
Script start
Timing: Jan 20 2025 10:58:55
Module start 'layout'
Timing: Jan 20 2025 10:58:55
Module start 'content'
Timing: Jan 20 2025 10:58:55
Module end 'content'
Timing: Jan 20 2025 10:58:55
Script end

Main resources:

Total runtime0.0183 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.0058 589.2891152.6406
Module start 'layout' 0.00580.0046 741.929739.4766
Module start 'content' 0.01040.0062 781.406389.4922
Module end 'content' 0.01660.0017 870.898434.3047
Script end 0.0183  905.2031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002413.0748140.0002
Check MTime0.00105.6552140.0001
Mysql Total
Database connection0.00063.186010.0006
Mysqli_queries0.004223.144830.0014
Looping result0.00000.119910.0000
Template Total0.00147.410.0014
Template load0.00063.437410.0006
Template processing0.00073.952210.0007
Override
Cache load0.00042.366310.0004
General
dbfile0.00137.274980.0002
String conversion0.00000.069140.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