Expand my Community achievements bar.

SOLVED

how to embed navigation core component inside HTL/sightly

Avatar

Level 1

Hi I have requirement where I wanted to use aem navigation(available across all templates) core component inside my project but dont want to expose in model.json.

Currently If I placed this template root level under jcr:content, this component still acts like a normal component and exposed in model.json.

But I dont want to expose I have one HTL in our project which is commonly used across all templates. I wanted to place directly inside this HTL like embed/hardcoded component.

May I know how can I do this ? I have tried below syntax didn't work. looks like some required properties are missing for nav to display.

 

<sly data-sly-resource="${resource @ resourceType='core/wcm/components/navigation/v1/navigation'}"></sly>

could someone guide me how we achieve this ? 

@arunpatidar 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

You can proxy the navigation component. and use sling delegation to extend the interface and remove the @Exporter

https://github.com/adobe/aem-core-wcm-components/blob/e1d4bc90eee4c87a0ffcd16ffe15b24f58396d87/bundl... 



Arun Patidar

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi,

You can proxy the navigation component. and use sling delegation to extend the interface and remove the @Exporter

https://github.com/adobe/aem-core-wcm-components/blob/e1d4bc90eee4c87a0ffcd16ffe15b24f58396d87/bundl... 



Arun Patidar