Forums / Setup & design / Content cache problem in a template.

Content cache problem in a template.

Author Message

Daniele Nocentini

Thursday 03 June 2010 5:59:07 am

I've a template with a list of file for download and I need to display the numbers of download for each file. I set in a first line of the template this:

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

but if I download a file and refresh the page, the number of download still zero but if I clean the content cache by admin interface and than refresh page in site the number of download of my file it's update.

How can I display the numbers of download every time the page was refreshed?

thanks.

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

André R.

Thursday 03 June 2010 6:30:14 am

First, you need to use global scope, root only works if it is the first level template for the node view, and my guess is this is in a attribute template. So:

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

Second, make sure there are no cache-blocks surrounding this code in the same template or parent templates.

Third, do you really need to set it to 0? Isn't it enough that it updates every minute and so on? (60)

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Daniele Nocentini

Thursday 03 June 2010 9:16:26 am

Hi Andrè thanks for your reply.

In the same template I have also a section that must be displayed only if a ezhttp template variable it's set but if I set cache_ttl to 600 this template section doesn't displayed when I click on this link:

{concat($node.url_alias, "?jolly=show")|ezurl}

{if ezhttp_hasvariable('jolly', 'get')}
{if eq(ezhttp('jolly', 'get'), 'show')}

.......

{/if}{/if}

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