Changing the value of one attribute

Author Message

Hugo Siles

Thursday 08 April 2004 2:01:04 pm

Hi, i want to know if it's posible to change the value of one object in one node. For example, I have extended the article class, now it has a new intenger attribute, what I want is that this attribute get incremented every time the node it's viewed.

In the template for viewing this article I put something like this

{set $node.data_map.volumen.data_int = inc($node.data_map.volumen.data_int) }

where volume is the integer attribute that I want to increment.. I'd apreciate any idea

thanks

Hugo

Marco Zinn

Thursday 15 April 2004 2:14:13 pm

Hi,
as i understand it, templates are just "viewing" the content of the objects (attributes), but the cannot modify it. So, your attempt will not work.
I guess, that you need an "operator", which might give you access to writing an attribute to the database.
What do you want to do? If you want a view-counter, i suggest, that you analyze the webserver log.
If you really need/want the data in the db, read about "workflows". There is a trigger called "after_read" or so, that might help you.

Marco
http://www.hyperroad-design.com

Hugo Siles

Friday 16 April 2004 5:50:13 am

Hi Marco,
thanks for your reply, I really apreciate it, but could you tell more about this workflow where I can find some documentation about this topic, or could you tell me what should I have to do.... thanks..

Cheers

Hugo

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 19 2025 03:21:03
Script start
Timing: Jan 19 2025 03:21:03
Module start 'layout'
Timing: Jan 19 2025 03:21:03
Module start 'content'
Timing: Jan 19 2025 03:21:04
Module end 'content'
Timing: Jan 19 2025 03:21:04
Script end

Main resources:

Total runtime0.8971 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.1563152.6250
Module start 'layout' 0.00600.0033 741.781339.4609
Module start 'content' 0.00930.8859 781.2422532.7578
Module end 'content' 0.89520.0018 1,314.000012.1563
Script end 0.8970  1,326.1563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3515160.0002
Check MTime0.00130.1469160.0001
Mysql Total
Database connection0.00070.078410.0007
Mysqli_queries0.847894.5005570.0149
Looping result0.00050.0549550.0000
Template Total0.864096.320.4320
Template load0.00200.228020.0010
Template processing0.861996.076520.4309
Template load and register function0.00010.014810.0001
states
state_id_array0.00090.095910.0009
state_identifier_array0.00150.168820.0008
Override
Cache load0.00160.1831210.0001
Sytem overhead
Fetch class attribute can translate value0.00050.060620.0003
Fetch class attribute name0.00110.117940.0003
XML
Image XML parsing0.00060.069920.0003
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00160.1771160.0001
String conversion0.00000.001140.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/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: 13
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs