Is it possible to alter content from a template?

Author Message

nigel dodd

Saturday 30 October 2004 1:44:00 pm

In an override template I have the line

{set $node.object.data_map.capacity.data_int=$i}

where $i is in scope and has been set to some numeric value. I have also tried the line without the data_int at the end. I have also tried it where admin is logged in to the front end. The "capacity" attribute of this object is never altered by this line and I am wondering if it at all possible to alter the values of the attributes of objects from templates.

It is likely that my newness to Ezpublish is responsible for some misunderstanding.

nigeldodd@blueyonder.co.uk

Balazs Halasy

Sunday 31 October 2004 2:25:36 am

Hi,

Unfortunately this is not the way eZ publish works. However, it is possible to achieve the stuff you wish to do, I would suggest two possible solutions:

1) Go into edit mode (by calling up /content/edit/object_id) and do it from there (create a special edit template for this case)

2) Write your own template operator or workflow event which takes care of this

Allman

nigel dodd

Monday 01 November 2004 2:00:30 am

Thanks for guidance.

I'm keen to alter content data in the way EzPub was designed. Presumably, then, I should use a form rather than try to do it through the template language.

The <i>Building an eZ publish site</i> tutorial shows how to add an object (guestbook entry class) from frontend interaction. It uses the content module action function (action.php) invoked with the NewButton sumbission. I've looked at the code and there is an equivalent EditButton. I want to edit the attribute value of an existing object. Is this documented only in the PHP file? I cannot find any other documentation.

nigeldodd@blueyonder.co.uk

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 01:31:13
Script start
Timing: Jan 31 2025 01:31:13
Module start 'layout'
Timing: Jan 31 2025 01:31:13
Module start 'content'
Timing: Jan 31 2025 01:31:14
Module end 'content'
Timing: Jan 31 2025 01:31:14
Script end

Main resources:

Total runtime1.2536 sec
Peak memory usage8,192.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 588.2656151.2266
Module start 'layout' 0.00480.0036 739.4922220.7344
Module start 'content' 0.00841.2444 960.22664,420.0156
Module end 'content' 1.25280.0008 5,380.242211.8125
Script end 1.2536  5,392.0547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2674160.0002
Check MTime0.00120.0966160.0001
Mysql Total
Database connection0.00060.047810.0006
Mysqli_queries1.169993.3245570.0205
Looping result0.00050.0425550.0000
Template Total1.203796.020.6019
Template load0.00220.172020.0011
Template processing1.201695.847020.6008
Template load and register function0.00120.095710.0012
states
state_id_array0.00090.075110.0009
state_identifier_array0.00130.106620.0007
Override
Cache load0.00180.1436230.0001
Sytem overhead
Fetch class attribute can translate value0.00170.133020.0008
Fetch class attribute name0.00200.157450.0004
XML
Image XML parsing0.00220.178420.0011
class_abstraction
Instantiating content class attribute0.00000.001260.0000
General
dbfile0.00210.1695220.0001
String conversion0.00000.000640.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs