7 Replies Latest reply on Jul 3, 2012 9:06 AM by Justin Klei

    Correct Syntax for Reteriving Current Template

    Jayatl

      I've been reading over the documentation and I'm have a difficult time getting the template being used on the current page.  In my component, all I want to do is use an IF statement to see if template MyTemplate is being used and apply some  HTML - if not, apply different HTML.

       

      <%@include file="/libs/foundation/global.jsp"%>
      <%@page session="false" 
                  import="com.day.cq.wcm.api.WCMMode"
      %>
      
      if (currentPage.getTemplate().equals(MyTemplate) {
          %>temp = my template<%
      } else {
          %>temp not equal to my template<%    
          }
      

       

      Can someone correct my syntax?