Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Slightly - Nav Component Extension


Level 2

Hi Team,


In my current project there is a requirement to build a Navigation Component with the addition of a categorized order which each child page will be mapped to its respective category. Something like below:


Parent Page (home)

  • Offers
  • Guidance
  • Pet Guides
    • Dog
      • How to train your dog
      • Producs to take care of your dog
    • Cat
      • 10 Tips to take care of your cat
    • Reptile


My first idea was to implement a method with this kind or return type "

List<HashMap<String,List<NavigationItem>>> getCategorizedItems().

The list insertion is doing fine but in Slightly, I'm not able to iterate over the second list that is inside the Hashmap. Is this a good approach?. if not, It'd helpful for me gather your suggestions for a better way to handle this scenario.


I checked some post "almost related" for iterating but none of them worked for me (not sure if I'm missing something or even if it's possible).




Any guidance that you can give me guys. I'll be appreciate it.






Topics help categorize Community content and increase your ability to discover relevant content.

2 Replies


Community Advisor



I think you should use a couple of sling models with the @ChildResource annotation, this is more clean and follow the best practices. If this gets more complex, perhaps even using a JSON structure is not a bad idea.


You can learn more about the annotation here:





Hope this helps.

Esteban Bustamante



@Luis_Ochoa Did you find the suggestion 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