Get Subtitle Page Property with HTL

Avatar

Avatar

JonMaguire

Avatar

JonMaguire

JonMaguire

09-09-2020

I'm wanting to retrieve the page subtitle and description using HTL. Using the AEM HTL Read–Eval–Print Loop environment to test, I'm able to get the description using ${item.description} but cannot get subtitle using the same format, ${item.subtitle}. Is there a different way to get the subtitle property?

View Entire Topic

Avatar

Avatar

ChitraMadan

MVP

Avatar

ChitraMadan

MVP

ChitraMadan
MVP

09-09-2020

Hi @JonMaguire ,

 

If your page has title and subtitle as shown below, it can be retrieved as:

 

Screenshot 2020-09-09 at 21.47.03.png

 

<ul data-sly-list="${currentPage.listChildren}">
<li>${item.title}</li>
<li>${item.properties.subtitle}</li>
</ul>

 

ChitraMadan_0-1599685547860.png