Hello Experts,
I m planning to develop a content recommendations component. My requirement is to customize the existing component so that it populates recommendation article cards using the tags property associated with the page's properties.
Appreciate if I get any guidance on how.
Solved! Go to Solution.
Views
Replies
Total Likes
@NeelaP I am assuming these recommendation articles are either pages , content fragments , experience fragments.
Inside your recommendation component sling model, you need to get the current page instance and get its page properties/tags , basically anything that you have setup to co-relate the current page to its recommended content.
Then, you pull in these recommendation articles using a JCR query that searches for all content with the relevant tags/properties.
Once, you have all of that, you can then send it to the Frontend to render your recommendation articles list.
@NeelaP I am assuming these recommendation articles are either pages , content fragments , experience fragments.
Inside your recommendation component sling model, you need to get the current page instance and get its page properties/tags , basically anything that you have setup to co-relate the current page to its recommended content.
Then, you pull in these recommendation articles using a JCR query that searches for all content with the relevant tags/properties.
Once, you have all of that, you can then send it to the Frontend to render your recommendation articles list.
@NeelaP - Assuming you want to match articles having same tags as the tags on current, in your component model, you can retrieve the tags associated with current page then use that data for JCR query based for your desired content paths in Java code. You should also evaluate if any index need to be created for the query.
Also if the content recommendations need to be updated based on the new articles created, you will also need to keep consideration for caching strategy according to your requirements.