Help with sorting assets *again* ;-)


(Andrew Harris) #1

I'm having a run on sorting problems, this one is unrelated to previous posts!

 

This page is a grouped asset listing. The group is based on metadata, and is working fine. The sorting of the assets themselves is also based on metadata - the Author field - and it's not quite working as I'd hoped.

 

Because the Author field can contain html (to allow for some author names to be bold), using the 'sort by metadata field value' option brings all the results where the first name is in bold to the top of the sort. It's (correctly, I supposed) sorting: "<strong>Zorro..." ahead of "Adam". Fair enough.

This only shows up as a problem in the 2103 group. The fact that the other two groups appear to sort correctly is simply a coincidence.

 

Anyway, undeterred, I created a new "Sorting by Asset Keyword Value" option using the keyword: %asset_metadata_Author^striphtml%, but when I attempt to sort by that value, my assets are all over the place. I can't even work out how they're being sorted it's so random.

 

I know the keyword returns a usable value because I've added %asset_metadata_Author^striphtml^maxchars:4% as a title attribute for each list item, and that's returning the expected values (hover over the items to view).

 

Why can't I use this keyword as a sort key? Any other options?

 

I should add that we are using an ancient version 4.0.3 - soon to be upgraded. Maybe it's an issue that's already been "sorted" ;-)


(Bart Banda) #2

I should add that we are using an ancient version 4.0.3 - soon to be upgraded. Maybe it's an issue that's already been "sorted" ;-)

 

This would be the first step to rectifying the problem, upgrade to the latest version and this will hopefully get resolved. If not, repost/recomment and then we can look at it again. :)


(Andrew Harris) #3

 

upgrade to the latest version and this will hopefully get resolved

 

Were it that easy. We are a *very* large organisation, and upgrades are enormous undertakings. Soon, in our case, is a relative term. I'd prefer not to put this off for that long unless it's a hopeless case.

 

Perhaps someone has a general idea about whether keyword modifiers such as the one I'm using should work as sort keys in this situation, or whether there may be another option available. I'm sure someone out there has something helpful to offer ;-)

 

<edit>

Actually, I just confirmed it's not the keyword modifier which is the problem. Sort by Asset Keyword Value is not working at all - even without the ^striphtml modifier.


(Andrew Harris) #4

Well, will you look at that. Resolved my own issue, and we didn't even have to upgrade!

 

As I'd said, I was using standard keyword notation in the assets "Sorting by Asset Keyword Value" field: %asset_metadata_Author^striphtml%, when in fact, the field requires the keyword sans percent symbols.

 

Silly me.

 

I'll just leave this conversation with myself here in case someone else finds it useful :-)