Quantcast
Channel: Adobe Community : Popular Discussions - CQ5 (read only)
Viewing all articles
Browse latest Browse all 12476

Correct Syntax for Reteriving Current Template

$
0
0

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?


Viewing all articles
Browse latest Browse all 12476

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>