I have created a "Secondary Navigation" component
and while creating backend HTL for this, I'm unable to achieve the desired output.
As I want it to take the "Navigation Root" path, whatever path has been provided instead of "currentPage" and iterate in that path to provide the child pages of the path provided in the "Navigation Root".
<li class="nav navbar-nav navbar-left" data-sly-repeat="${currentPage.listChildren}">
<a href="${item.path}.html">${item.title}</a>
</li>
Please provide the correct backend HTL code along with the java code (sling model).
Also explain the logic.
Solved! Go to Solution.
Views
Replies
Total Likes
If you are referring to the AEM core components, you can check the code by yourself due the project is open source, here is the class you are looking for: https://github.com/adobe/aem-core-wcm-components/blob/main/bundles/core/src/main/java/com/adobe/cq/w...
You can always extend and customize the model by following the delegation pattern, you can learn more here:
https://github.com/adobe/aem-core-wcm-components/wiki/Delegation-Pattern-for-Sling-Models
https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/customiz...
If you are referring to the AEM core components, you can check the code by yourself due the project is open source, here is the class you are looking for: https://github.com/adobe/aem-core-wcm-components/blob/main/bundles/core/src/main/java/com/adobe/cq/w...
You can always extend and customize the model by following the delegation pattern, you can learn more here:
https://github.com/adobe/aem-core-wcm-components/wiki/Delegation-Pattern-for-Sling-Models
https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/customiz...
You can't do this with HTL alone.
You have to write sling model to convert navigation root to Page object and then iterate for children.