Update variable in a content cached template

Author Message

Daniele Nocentini

Thursday 25 August 2011 1:42:08 am

I have a site with a big menu on top in pagelayout.tpl, in this menu a user can specify a city where it comes from. when a user click on a link of city a custom module it's called and I write a cookie with the id of a node that corresponding of a city, now if a user go to other node/view of a content object I can recover the value of a cookie so I can change information depend on a city that user has chosen.

The problem is if a user change a city because the cookie is updated but the value in template view full no because it's cached from content cache.

I know that I can use this:

{set-block scope=root variable=cache_ttl}0{/set-block}

but there is another way to bypass content cache when I want to read a cookie value?

Antica Bottega Digitale srl
http://www.abd.it

Hamdi Laadhari

Thursday 25 August 2011 6:31:06 am

why don't you try using ezpreference system to save tha piece od data, ezpreference is a cache criteria

Certified eZ Publish Entreprise 4.5
http://www.laadhari.fr

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 29 2025 13:43:28
Script start
Timing: Jan 29 2025 13:43:28
Module start 'layout'
Timing: Jan 29 2025 13:43:28
Module start 'content'
Timing: Jan 29 2025 13:43:28
Module end 'content'
Timing: Jan 29 2025 13:43:28
Script end

Main resources:

Total runtime0.0144 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 588.2578151.2266
Module start 'layout' 0.00510.0026 739.484436.6875
Module start 'content' 0.00770.0054 776.171990.0781
Module end 'content' 0.01310.0013 866.250029.9766
Script end 0.0144  896.2266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002416.7936140.0002
Check MTime0.00117.6346140.0001
Mysql Total
Database connection0.00095.963410.0009
Mysqli_queries0.002316.208930.0008
Looping result0.00000.082610.0000
Template Total0.00106.710.0010
Template load0.00075.098010.0007
Template processing0.00021.572210.0002
Override
Cache load0.00053.471310.0005
General
dbfile0.00031.798480.0000
String conversion0.00000.047940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

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

Time used to render debug report: 0.0001 secs