Global Objects
HTL Examples
Get title of page using HTL
- page
- currentPage
- properties
- inheritedPageProperties
- currentDesign
- currentSession
- wcmmode
Refer for list of global objects
Converting JSP Method into HTL
Converting JSP Method into HTL
- JSP : currentPage.getContentResource()).getResourceType()
- HTL 1 : ${currentPage.getContentResource.getResourceType}
- HTL2 : ${currentPage.contentResource.resourceType}
HTL Examples
Get title of page using HTL
- ${page.title}
Get any custom property from page using HTL
- ${page.getProperties['root/responsivegrid/content/customPropertyName']
Handling Property Array using HTL
<div data-sly-list = "${currentPage.getProperties['component/reference']}">
${item}
</div>
( reference is property name , component is component node under jcr:content)
Get date using HTL
<div data-sly-list = "${currentPage.getProperties['component/reference']}">
${item}
</div>
( reference is property name , component is component node under jcr:content)
Get date using HTL
- ${ 'dd-MMMM-yyyy hh:mm:ss' @
format=currentPage.lastModified,
timezone='IST',
locale='en'}
Get logged in user using HTL
- ${currentSession.userID}
Get design path using HTL
- ${currentDesign.path}
Check wcmmode using HTL
- ${wcmmode.edit}