changing attribute value

Author Message

Marko Žmak

Monday 21 March 2005 4:29:23 pm

How can I change the value of an attribute from some template?

I would like too make a template that each time when is loaded changes an attribute of some object. But without having to POST some data on some other page.

Is it possible?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Frederik Holljen

Wednesday 23 March 2005 1:38:20 am

this is not the way eZ publish is designed because caches mean that you don't know how often the code in the templates is actually run. However, you can set a template not to be cached which means that it will always be run (much slower though). You can quite easily make template operators that change data in the database.

Marko Žmak

Wednesday 23 March 2005 2:44:03 pm

Actually I was wondering if there's an existing eZ operator for that.

But If you say this is not the way to do it, maybe there's some other way to do what I need...

I need to increase a counter every time an image or article is loaded. So that I can track how many times it was viewed.

I already asked about it in the forum and got anwser to use the apache log. But the example I was given only shows how to get the "most popular" articles, not how to see how many times each one was viewed. How do I do that?

Also, what if I don't have acces to the apache log?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

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 12:42:52
Script start
Timing: Jan 19 2025 12:42:52
Module start 'layout'
Timing: Jan 19 2025 12:42:52
Module start 'content'
Timing: Jan 19 2025 12:42:53
Module end 'content'
Timing: Jan 19 2025 12:42:53
Script end

Main resources:

Total runtime1.1882 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.0057 589.1563152.6250
Module start 'layout' 0.00570.0032 741.781339.4453
Module start 'content' 0.00891.1781 781.2266543.8359
Module end 'content' 1.18700.0012 1,325.062512.1641
Script end 1.1882  1,337.2266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2769160.0002
Check MTime0.00140.1185160.0001
Mysql Total
Database connection0.00090.072910.0009
Mysqli_queries1.142896.1778570.0200
Looping result0.00050.0400550.0000
Template Total1.155897.320.5779
Template load0.00160.137020.0008
Template processing1.154297.134220.5771
Template load and register function0.00010.008010.0001
states
state_id_array0.00120.100810.0012
state_identifier_array0.00150.124920.0007
Override
Cache load0.00130.1120170.0001
Sytem overhead
Fetch class attribute can translate value0.00070.062120.0004
Fetch class attribute name0.00100.083050.0002
XML
Image XML parsing0.00100.083320.0005
class_abstraction
Instantiating content class attribute0.00000.000660.0000
General
dbfile0.00090.0738240.0000
String conversion0.00000.000740.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
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs