I believe column view is the default for users viewing on desktop... but for certain 'decentralized' authors responsible for very specific items, I would prefer they land on the page in card view to keep things as straightforward as possible.
Is there a URL parameter or something I can include in the URL to determine what view option is selected? e.g: http://localhost:4502/sites.html/content/brand/product/internal-resources?view=card
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @fourthWaII ,
You have to extend collectionpage
/libs/granite/ui/components/shell/collectionpage/collectionpage.jsp
This is the default code that sets the view (column view) of the page when it loads:
String targetViewName = getTargetViewName(slingRequest, consoleId); List viewCache = new ArrayList(); Resource currentView = null; int i = 0; for (Iterator it = resource.getChild("views").listChildren(); it.hasNext(); i++) { Resource item = it.next(); if (i == 0 || item.getName().equals(targetViewName)) { currentView = item; } viewCache.add(item); }
For more details please visit this article: http://aem-podcast.com/2017/aem-interface/default-views-aem-sites-content-tree/#.Yrm3KOzMJb8
Hope that helps!
Regards,
Santosh
Hi @fourthWaII ,
You have to extend collectionpage
/libs/granite/ui/components/shell/collectionpage/collectionpage.jsp
This is the default code that sets the view (column view) of the page when it loads:
String targetViewName = getTargetViewName(slingRequest, consoleId); List viewCache = new ArrayList(); Resource currentView = null; int i = 0; for (Iterator it = resource.getChild("views").listChildren(); it.hasNext(); i++) { Resource item = it.next(); if (i == 0 || item.getName().equals(targetViewName)) { currentView = item; } viewCache.add(item); }
For more details please visit this article: http://aem-podcast.com/2017/aem-interface/default-views-aem-sites-content-tree/#.Yrm3KOzMJb8
Hope that helps!
Regards,
Santosh
1. Overlay the /libs/dam/gui/content/assets/jcr:content/views/card and under /apps/dam/gui/content/assets/jcr:content/views/card
2. Add a property sling:orderBefore to the list node , something like below
name: sling:orderBefore String card
3. The XML looks something like this
<views jcr:primaryType=”nt:unstructured”>
<card
jcr:primaryType=”nt:unstructured”
sling:orderBefore=”card”/>
</views>
You can do the same for card view.
Thanks
Himanshu
Thanks @SantoshSai for highlighting.
Hi,
There is a cookie, which is responsible for showing card layout, if someone you can inject this cookie from dispatcher/slingFilter based on the IP or usergroup then you will be fine
cq-sites | card |
Views
Likes
Replies