Trying to create a list of recommended next pages using the List component and Build from Tags option. Currently the component is including itself in the results, since that page does indeed have the selected tag along with other pages in the same directory.
Is there any easy way to prevent the page from including itself in the list?
More detail: building a collection of case study pages. Using tags to identify the type of case study and product category. On the bottom of the case study page, trying to set up a teaser for other related case study pages based on the tag. For obvious reasons, don't want the current page to be displayed in the list of recommended other stories.
Solved! Go to Solution.
Views
Replies
Total Likes
I believe list component using tag manager api to find the resource using
RangeIterator<Resource> find(java.lang.String basePath, java.lang.String[] tagIDs)
there is no ootb method available to filter out the path. In order to achieve this for your use case you need to manually filter out the base path.
I believe list component using tag manager api to find the resource using
RangeIterator<Resource> find(java.lang.String basePath, java.lang.String[] tagIDs)
there is no ootb method available to filter out the path. In order to achieve this for your use case you need to manually filter out the base path.
You can also think of filtering it out on the HTL side. You can simply add a check for currentPage.path
<ul data-sly-use.list="com.adobe.cq.wcm.core.components.models.List">
data-sly-list.item="${list.listItems}">
<li data-sly-test="${item.path != currentPage.path}">${item.title}</li>
</ul>
This is just a sample.
Views
Likes
Replies