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.

[email protected]

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.

[email protected]

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.