I have used the {{depend}} template functionality before using email templates and I am wondering if this is possible within CMS Static Blocks, for example:
<a href="{{store url='customer/account'}}">Login/Account</a>
Could be updated to:
<a href="{{store url='customer/account'}}">
{{depend loggedIn}}Account{{/depend}}
{{depend loggedOut}}Login{{/depend}}
</a>
Which could be useful to allow customers the option to update these within the CMS Block whilst keeping the dependency functionality.
Obviously this dependency depends on the variables being available to the block itself which the email template achieves using the following (which could be applied to the cms block/model with a rewrite):
public function setTemplateParams(array $templateParams)
{
return $this->setData('template_params', $templateParams);
}
What I am unsure on is how the templating language used within the block accesses this information, adding {{depend}}
tags to a block simply outputs as plain text. I assume there is a compilation step applied before the html is rendered, but a nudge in the right direction as to how to proceed would be of great help.