Automatically adding references to subsections at the end of each topic

Anish2

04-06-2020

I'm looking for a way to automatically add references to subsections at the end of each topic. Is there any way to do this using AEM? I am using AEM 

 

That is, if I have a topic at level 1 and 3 topics at level 2, I am looking at ways to insert links automatically to the end of the topic with links to the topics at level 2,preferably as an unordered list.

Accepted Solutions (1)

Accepted Solutions (1)

Shashi_Mulugu

MVP

04-06-2020

Assuming you are referring topic as page in AEM sites, you are building a blog kind of website where you want to display all topics.

 

You can develop a sling model which will get current page as source and get all child pages, if need recursively  (You can always put some page properties to hide some topics from referring ) and display in the parent page.

 

Call the model in page component so that whenever a page is created a top-levels, child pages are automatically pulled up.

Answers (2)

Answers (2)

BrianKasingli

MVP

04-06-2020

@Anish2,

One other approach is to use AEM Tags (cq:Tags). You can tag all blog article pages, then add an additional page property configurable, with an option to choose one or more cq:Tags of for "showRelatedPages".

The blog article page will display all the related pages in a list view of all the pages that are tagged with the correct tagging based on the page property.

This work will include a new AEM Component, with Sling Model backend logic.

It would also make sense to tag all your blog article pages, so you can easily query for pages that are categorised in the same category for the future.

Veena_Vikram

MVP

05-06-2020

I think one of the best approach considering the capabilities of AEM is to use tags as suggested by @BrianKasingli . U can tag any page at any level with a meaningful tag. Write a component which will pull latest articles based on your tags .