Hello Everyone,
I can display child pages title using the below Sightly code.
<ul data-sly-list="${currentPage.listChildren}">
<li>${item.title}</li>
</ul>
Is it possible to list the Navigation title of child pages using Sightly? Tried below logic, But no luck
<ul data-sly-list="${currentPage.listChildren}">
<li>${item.navTitle}</li>
</ul>
Solved! Go to Solution.
Views
Replies
Total Likes
@Mahesh_Gunaje : There is no function as navTitle in com.day.cq.wcm.api.Page api.
Please try with: ${item.navigationTitle}
thanks.
@Mahesh_Gunaje can you try below code
@Mahesh_Gunaje : There is no function as navTitle in com.day.cq.wcm.api.Page api.
Please try with: ${item.navigationTitle}
thanks.
Thanks for the solution. This works.
There is no function as navTitle in com.day.cq.wcm.api.Page api.: True. Just checked the details.
My query: in the jcr:content, I can see the jcr property as navTitle. So, how come below statement works fine?
<ul data-sly-list="${currentPage.listChildren}">
<li>${item.navigationTitle}</li>
</ul>
@Mahesh_Gunaje : If you recall, getting page or component values in your HTL/Sightly via sling model (APIs) is by using their getter method name (remove get prefix, and lowercase first letter), so getNavigationTitle becomes navigationTitle.
Usually, you would have seen people naming field values and their getter methods similarly, maybe that's why you felt that way. But as I mentioned earlier, it is based on the getter method name.
In the impl class of your sling model, they would have been getting the value of actual property using their name i.e navTitle
thanks.
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies