tcarter
13 years agoHelper
Is there a Freemarker object for templates?
I have a custom component that loads a bunch of javascript for the desktop template that I do not want loading for our mobile template.
Is there a Freemarker object I can use?
Here is a fictitious example of what I am looking for:
<#if (template.name != "Mobile") >
<#-- load all the heavy javascript not needed for mobile here -->
</#if>
You can use the "clientDevice" freemarker context object -- here is an example:
<#if clientDevice.mobile> <#-- load all the heavy javascript not needed for mobile here --> </#if>