What controls the order of new assets in card view for a folder?

Avatar

Avatar
Validate 1
Level 1
GFox
Level 1

Likes

0 likes

Total Posts

13 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Applaud 5
View profile

Avatar
Validate 1
Level 1
GFox
Level 1

Likes

0 likes

Total Posts

13 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Applaud 5
View profile
GFox
Level 1

18-10-2020

I've noticed that in card view, newly added assets can either be at the top of the folder UI or at the bottom? All are marked "new" and folder properties are typically the same, sometimes orderable is selected (I understand orderable is for moving around in list view - not card).   Because there are often 1000's of assets in a folder I want to force all new assets to top of the folder for all folders in the system.   I know we can filter on last modified or use list view but that is another set of clicks and it would be good to know how AEM treats ingesting content into folders. 

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar
Ignite 5
Employee
davidjgonzalezz
Employee

Likes

36 likes

Total Posts

53 posts

Correct reply

16 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 3
Give Back
View profile

Avatar
Ignite 5
Employee
davidjgonzalezz
Employee

Likes

36 likes

Total Posts

53 posts

Correct reply

16 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 3
Give Back
View profile
davidjgonzalezz
Employee

19-10-2020

Technically the query that is run to collect the results in the card view of an assets folder is:

 

/jcr:root/content/dam/example/* order by @jcr:created descending

 

This means assets are sorted by the dam:Asset's jcr:created property in descending order.

 

Is it possible you are MOVING assets from one folder in AEM assets to another? Doing this does not change the moved asset's jcr:created date which might make it appear "older" than what you'd expect. 

Can you check the jcr:created dates on some of these assets that are showing up at the bottom of the folder listing and verifying their dam:Asset's jcr:created date is in fact newer (larger) than those assets that show first in card view?

 

Avatar

Avatar
Ignite 5
Employee
davidjgonzalezz
Employee

Likes

36 likes

Total Posts

53 posts

Correct reply

16 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 3
Give Back
View profile

Avatar
Ignite 5
Employee
davidjgonzalezz
Employee

Likes

36 likes

Total Posts

53 posts

Correct reply

16 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 3
Give Back
View profile
davidjgonzalezz
Employee

20-10-2020

Ah - so it sounds like your query is specifically about the Link Share card listing (which has a completely different implementation than the "normal" Assets Files view listing) .. it might be worth to update your Post title to reflect that.

 

The Link Share view, by default, lists assets in their "natural" order - it basically iterates over all the assets in a folder and displays them IN that order (for card view).

If you add: ...&sortDir=desc&sortName=created   to the folder URL you can force a sort order of the cards, however, the resources [1] that make up the Link Share UI are marked granite:internalArea [2] so you cannot (safely) overlay them to add these params.

The adhocsharedatasource.jsp script [3] however can be overlayed, and you can adjust the code to force default sorting on the "created" column and descending as shown in the attached screenshot..

 

 

    } else {
        ResourceSorter sorter = sling.getService(ResourceSorter.class);
        itr = sorter.sort(rv.iterator(), "created", true, rows, offset, null).iterator();
        rv.clear();
        while(itr.hasNext()) {
            Resource res = itr.next();
            rv.add(res);
        }
    }

 

 

adhocsharedatasource.png

 

[1] /libs/dam/gui/content/adhocassetsharepage/jcr:content/body/items/content/items/wizard/items/wizard.content/body/items/landingpage/views/card/datasource

[2] https://docs.adobe.com/content/help/en/experience-manager-64/deploying/upgrading/sustainable-upgrade...

[3] /libs/dam/gui/coral/components/admin/adhocassetshare/adhocsharedatasource/adhocsharedatasource.jsp