Expand my Community achievements bar.

SOLVED

Displaying Custom Page Properties with Navigation core component

Avatar

Level 2

Hi everyone.

 

I am using the navigation core component given by adobe to create my header and I have implemented it into my header component without making any changes. Now, I have added custom page properties and I want to display them using my navigation component. I cannot use the current page's page properties since I want to display all the level 0's page properties. 

I've tried extending the core navigation model but there's a lot of different models I will need to change. Is there any other way to achieve this or is extending the core model the only way?

Thank you!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @karthik2906 

 

Please use Delegation instead of extending.

The explanation is available on following link: https://kiransg.com/2021/11/07/aem-core-component-delegation/

 

This will save you from copying a lot of files 


Aanchal Sikka

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

Hello @karthik2906 

 

Please use Delegation instead of extending.

The explanation is available on following link: https://kiransg.com/2021/11/07/aem-core-component-delegation/

 

This will save you from copying a lot of files 


Aanchal Sikka

Avatar

Level 2

Thank you. I have done it in another way without extending for now but I will try delegation as well.

Avatar

Community Advisor

@karthik2906  Try below Sightly html

 

<!-- Assuming "customTitle" is the name of your custom property -->
<li data-sly-repeat="${properties.navigationRoot.listChildren}">
<a href="${item.path}">${item.customTitle @ context='unsafe'}</a>
</li>

 

Avatar

Administrator

@karthik2906 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni