Is it possible to do conditional asset sorting


(Ryan Archer) #1

Is it possible to do conditional asset sorting on an asset listing page?

For instance, we want to customise a news item feed by using cookies that are triggered by a select menu which cause a trigger to fire which places public user in a defined user group for a session (this functionality we already have working).

 

Works a treat in combination with setting conditionals on standard pages. However for something more complex we use an asset listing page to produce a list of news items. I have setup a special metadata field called "featured", when you check it for a particular item - it then becomes a 'sticky' and gets featured on top of the list.

 

Now to push the envelope further, I have been asked if the particular feature item will only show when it matches the category for the user group. I also have a metadata field setup where the news item can be allocated a category (X,Y,Z).

 

So I am looking for...

 

IE User group XX should only see featured item XX above all the news items

User group YY should only see featured item YY above all the news items.

 

I'm unsure as to how to accomplish this. Has anyone out there got some ideas?


(Ryan Archer) #2

Managed to figure this one out. Asset listing pages cannot discriminate that well (well to my knowledge). I used Search pages instead as they have many similar parameters to asset listing pages but gave more ability to customise the results.

 

The solution ended up being 2 x 3 sets of Search pages (3x featured item and 3 x list of other items) - all using search parameters via metadata.

Then using a Paint layout (which was applied to a standard page) to then use conditional keywords, then in the paint layout using conditionals plus nesting all of these search pages via %globals_asset_contents% global keyword.

 

Complicated much?


(Bart Banda) #3

I'm not entirely across the whole implementation yet but with making personalised featured items at the top based on the user group the user is in, I would also use a search page and dynamic search field value that gets added to the search page generation. This search field value could be a session var created when the user logs in to their user group, could be the name of the user group even. Then you pass that to the search page as a stored search value and still sort the search page by score (giving the dynamic value a higher score than normal so that those dynamic featured items are always at the top). But the overall requirements might be much more complicated than that....


(Ryan Archer) #4

Sounds like another good alternative solution. Right now there are three user groups so I can probably get away with not using dynamic search field at this stage but worth keeping in mind if more customisation is required in the future.


(Tim) #5

not sure if this solution would be relevant to your situation, but you could change those landing pages into standard pages with variations. Then embed a different asset listing depending on the persona. Then pre-configure the embedded asset listings to match the persona.