Hi, I would like to show a list of content fragments with title something similar to list of blogs/post & when title is clicked, it should load full page content where respective content fragments is used.
All the blogs/content fragments will be created in author instance only. After some search, I found this article but they didn't share how it was created or achieved it. I want to create component like on This page but just want to show title with link to full page.
Can you please suggest as to how can I achieve this?
Thanks, in advance!
Solved! Go to Solution.
Views
Replies
Total Likes
hello @sesmic
The behavior can be achieved by using the ReferenceSearch. It can return the path of the Page referencing the Asset.
public Page getAssetReference(final String assetPath){
ReferenceSearch referenceSearch = new ReferenceSearch();
referenceSearch.setExact(true);
referenceSearch.setHollow(false);
referenceSearch.setMaxReferencesPerPage(-1);
Collection<ReferenceSearch.Info> resultSet = referenceSearch.search(resolver, assetPath).values();
for (ReferenceSearch.Info info: resultSet) {
return info.getPage();
}
return null;
}
You would also need to extend the Content Fragment List component [0] via Delegation pattern [1], to render the Page Link on UI.
hello @sesmic
The behavior can be achieved by using the ReferenceSearch. It can return the path of the Page referencing the Asset.
public Page getAssetReference(final String assetPath){
ReferenceSearch referenceSearch = new ReferenceSearch();
referenceSearch.setExact(true);
referenceSearch.setHollow(false);
referenceSearch.setMaxReferencesPerPage(-1);
Collection<ReferenceSearch.Info> resultSet = referenceSearch.search(resolver, assetPath).values();
for (ReferenceSearch.Info info: resultSet) {
return info.getPage();
}
return null;
}
You would also need to extend the Content Fragment List component [0] via Delegation pattern [1], to render the Page Link on UI.
Views
Likes
Replies