I have an asset Listing Page that I’m trying to do some sorting
example: sort each element by asset name (alphabetically and by metadata value start time)
A 9:30 am - 10:am
A 9:30 am - 10:am
B 10:00 am - 10:30 am
B 10:00 am - 10:30 am
etc
I can sort alphabetically using the keyword sort but how do I include the time (metadata) as well??
PS I got this to work using javascript but was a lot of mucking around, would be preferable to do it all within matrix - I’m still keen to hear from anyone who has had similar problems.
Sounds like a plan and if I understand you correctly:
1: add another text field to the existing Schema (I called it custom_sort)
2: Add this to the default value %asset_name%%metadata_field_XXXXXXX_start_time^date_format:hi%
I’m guessing XXXXXX is the field id of start_time
3: sorting on the asset listing sort by metadata and select the newly created metadata data field (custom_sort)
Now I must be doing something wrong because I see this value:
<meta name="custom_sort" content="Talking Global Studies with Culture and Heritage
%metadata_field_1723808_start_date^date_format:hi%" />
Please note: start_date is a metadata date field not a text field.
Ok, got it - I’m still not 100% convinced that this works though unless I still don’t have the right settings:
From what I can gather the time format, say 1:00 pm = 0100 would sit higher than 9:00 am = 0900?
The sorting on the asset listing is: default sort-by option: metadata field, sort type: raw value, sort direction: descending.
But as you can see in the screen shot asset name - 0100 sits at the top. Have I missed something?