Automatically adding references to subsections at the end of each topic

Avatar

Avatar
Ignite 1
Level 1
Anish2
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Ignite 1
Boost 1
View profile

Avatar
Ignite 1
Level 1
Anish2
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Ignite 1
Boost 1
View profile
Anish2
Level 1

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)

Avatar

Avatar
Springboard
MVP
Shashi_Mulugu
MVP

Likes

232 likes

Total Posts

294 posts

Correct reply

67 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Applaud 100
Establish
View profile

Avatar
Springboard
MVP
Shashi_Mulugu
MVP

Likes

232 likes

Total Posts

294 posts

Correct reply

67 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Applaud 100
Establish
View profile
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)

Avatar

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

645 likes

Total Posts

607 posts

Correct reply

239 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

645 likes

Total Posts

607 posts

Correct reply

239 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
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.

Avatar

Avatar
Establish
MVP
Veena_Vikram
MVP

Likes

484 likes

Total Posts

1,048 posts

Correct reply

121 solutions
Top badges earned
Establish
Coach
Contributor 2
Seeker
Ignite 5
View profile

Avatar
Establish
MVP
Veena_Vikram
MVP

Likes

484 likes

Total Posts

1,048 posts

Correct reply

121 solutions
Top badges earned
Establish
Coach
Contributor 2
Seeker
Ignite 5
View profile
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 .