Cache issue...

Author Message

Jorge estévez

Friday 23 October 2009 7:49:19 am

Hello,

I would like to do the following:

{def $current_user=fetch( user, current_user )}
{if $current_user.is_logged_in}	
           {def $basket=fetch( 'shop', 'basket' )}
            {if $basket.is_empty}
            		Do something (show image 1)
            {else}
           		Do something else (show image 2)
            {/if}
{else}
		Stay put
{/if}

The problem is that this code (for each product in a list) is inserted as a include into a “line/product.tpl” template.

The product list (with all the products) is cached, so images that should be displayed are not updated as they should, and keeps showing the same image since the last “clear cache”.

On the other hand the same code was added at the page_topbox.tpl and it works just fine.

I would like to try something like

<NO CACHE ATT ALL, ALWAYS PROCESS>
      The code
</NO CACHE ATT ALL, ALWAYS PROCESS>

Any other ideas welcomed.

By the way it’s an ez 3.10 website

Any help? thanks

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

Gabriel Finkelstein

Monday 26 October 2009 10:41:18 am

Views are always cached by default. To change it, add

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

at the top of your tpl, and then a cache-block around the code you do want to get cached.

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