This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Setup & design » Setting the $extra_cache_key variable...
expandshrink

Setting the $extra_cache_key variable in pagelayout

Setting the $extra_cache_key variable in pagelayout

Wednesday 22 August 2012 10:31:19 am - 1 reply

In many example pagelayout templates, including ezwebin and the new ezdemo extension, there are cache blocks like this:

 <span>{cache-block keys=array( $module_result.uri, $basket_is_empty, $current_user.contentobject_id, $extra_cache_key )}</span>

There are checks on whether the $extra_cache_key is already defined, or else it will be set to an empty value.

Is it possible to set this value from somewhere else (a template executed during the content rendering), without overriding the pagelayout template? If I understand correctly, the variable is scoped locally for the template, but why is there a is_set-check there if it cannot be set?

Thanks.

Wednesday 22 August 2012 11:05:58 am

The last commit on this code on this was by Lukasz Serwatka <ls@ez.no> on 24/02/09 1:01 AM:

- Added $extra_cache_key
- Added more helper tagss

There's a couple of possibilities I can think of, off-hand:

  1. It's just a guide - you can set up the "extra cache key" to be whatever you want
  2. There was some grand plan for it, which never eventuated.

I think it's probably the former.  You can use $persistent_variable to carry values over from content templates.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from