Displaying Custom Page Properties with Navigation core component | Community
Skip to main content
Level 2
Sep 25, 2023 11:23 AM UTC
Solved

Displaying Custom Page Properties with Navigation core component

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!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
aanchal-sikka
aanchal-sikkaAccepted solution
New Participant
Sep 25, 2023 12:18 PM UTC

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

4 replies

kautuk_sahni
Employee
Sep 26, 2023 10:43 AM UTC

@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.

Translate
Kautuk Sahni
Jagadeesh_Prakash
New Participant
Sep 25, 2023 1:37 PM UTC

@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>

 

Translate
aanchal-sikka
aanchal-sikkaAccepted solution
New Participant
Sep 25, 2023 12:18 PM UTC

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 

Translate
Aanchal Sikka
Level 2
Sep 27, 2023 4:07 AM UTC

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

Translate