• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

accessing simpleCache from templates


Well-known member
For sessions, there is no need to added anything to the controller/model/view since the session can be accessed from a template as:


for example:
<xen:if is="!{$session.robotId}">
   Xenforo has not detected me as a crawler
Is there something similar for simpleCache (since its globally fetched and requires 0 query overhead)
Or do I have to push something in the controller every time I need to access simpleCache in a template ?

Chris D

XenForo developer
Staff member

<xen:if is="{$xenCache.userUpgradeCount}"><li><a
    class="{xen:if "{$selectedKey} == 'account/upgrades'", 'secondaryContent', 'primaryContent'}"
    href="{xen:link account/upgrades}">{xen:phrase account_upgrades}</a></li></xen:if>

Chris D

XenForo developer
Staff member
Incidentally you can see default template params by going to:

They will apply to public and admin templates.

Then there's some Admin/Install/Public specific ones too.