Forums / Developer / Preventing caching of some template

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Preventing caching of some template

Author Message

Eirik Alfstad Johansen

Friday 10 October 2003 2:55:27 am

Hi,

I have an if-else section as part of my pagelayout template. The section is fetched from the header of the admin template, and produces a log in/log out message depending on whether the user is logged in or not.

The problem is, however, that because the section is part of a template, the section result is cached along with the template. How can I prevent this?

I'm guessing that the solution lies somewhere in putting the section in a separate template and turning of caching for that template, but how do I control caching at a seperate templates level? Is it even possible?

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Marco Zinn

Tuesday 14 October 2003 8:02:02 am

For turning of caching in a given template, see here:
http://www.ez.no/developer/ez_publish_3/documentation/incoming/how_to_set_cache_expire_time_or_disable_cache_in_template

But I think, your problem is easier: Close the cache-block, that probably starts your pagelayout.tpl, before your if-else-section starts.
See here: http://www.ez.no/developer/ez_publish_3/documentation/development/libraries/ez_template/functions/function_list

As the admin siteaccess is known to work well ;), you can examine the admin's pagelayout and look out for "cache-block" diretives there.

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

Eirik Alfstad Johansen

Sunday 19 October 2003 7:09:29 am

Thanks for the tip, Marco!

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/