Custom navigation menu using Sling Model and HTL
- July 21, 2023
- 3 replies
- 1253 views
Tried building a dynamic navigation menu with a Sling Model that maps to the navigation data in AEM. In this, I tried to create a NavigationModel class that retrieves the current page and its siblings, and builds a list of NavigationItem objects that represent each page in the navigation menu.
So when I used @PostConstruct annotation to initialize the items list it is giving error as "method buildNavigation(Page) is undefined for the type NavigationModel" & "context cannot be resolved" and also while creating buildNavigation method which uses list of array for child pages giving "The type List is not generic; it cannot be parameterized with arguments" error.In the NavigationItem class showing error in the properties of navigation menu. The error it is throwing "methods undefined for the type Page". Attached the error screenshots for reference.