Forums / Setup & design / Is it possible to alter content from a template?

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

eZ debug

Timing: Jan 30 2025 21:40:07
Script start
Timing: Jan 30 2025 21:40:07
Module start 'content'
Timing: Jan 30 2025 21:40:07
Module end 'content'
Timing: Jan 30 2025 21:40:07
Script end

Main resources:

Total runtime0.2212 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0084 588.0781370.2734
Module start 'content' 0.00840.0149 958.35161,001.7031
Module end 'content' 0.02340.1977 1,960.05473,890.2891
Script end 0.2211  5,850.3438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00512.2839200.0003
Check MTime0.00140.6234200.0001
Mysql Total
Database connection0.00090.409210.0009
Mysqli_queries0.119253.87111410.0008
Looping result0.00150.65881390.0000
Template Total0.197289.210.1972
Template load0.00100.474710.0010
Template processing0.196288.684410.1962
Override
Cache load0.00070.335010.0007
Sytem overhead
Fetch class attribute can translate value0.00220.977010.0022
XML
Image XML parsing0.00030.127510.0003
General
dbfile0.00723.2399200.0004
String conversion0.00000.002730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

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

Time used to render debug report: 0.0002 secs