


<div class="xyz">
<sly data-sly-list.childPageLvl2="${childPageLvl1.childPages}">
---Iterate and print all child pages---
</sly>
-----View All--- (after child pages are printed then it print 'view all" as a last line)
</div>
Hi Team,
As per above code, it print all 'child pages of root page' and then it prints 'View All' at last
if 'child pages are not available for root page' it only prints 'View All' at last.
My requirement is,
It should print 'View All' only if 'child pages of root pages is available'.
it should not print 'View All' at last if child pages are not available for root page. (like if else condition)
Please suggest?
Views
Replies
Sign in to like this content
Total Likes
Hi @chandramohanred,
Please use the below code:
<sly data-sly-test="${childPageLvl2.size > 0}"> View All </sly>
Hope this helps.
Thanks,
Kiran Vedantam.
Hi @chandramohanred,
Please use the below code:
<sly data-sly-test="${childPageLvl2.size > 0}"> View All </sly>
Hope this helps.
Thanks,
Kiran Vedantam.