Forum Discussion

tcarter's avatar
tcarter
Helper
13 years ago
Solved

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 fictitio...
  • DougS's avatar
    13 years ago

    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>