-
It appears that on the Timeline page, within a block, such as a year, items are displayed in semi-random order. Items with a shared date are generally together, but then they may be followed by an item that should be displayed above that group, as it has an earlier date. Is it possible to prevent this behavior? #99 addressed the Browse page's randomization by editing JavaScript, but the Timeline's equivalent (_includes/js/timeline-js.html) does not have equivalent code. Where is the code for this behavior located, or is there some other way to prevent this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
@tprus-luc the Timeline page is created all with Liquid (not javascript in this case). You can find how things come together by starting at the page stub and looking at the layouts it calls. |
Beta Was this translation helpful? Give feedback.
@tprus-luc sorry, on the "sort" I left out the field to add, it should look like:
{%- assign inYear = items | where_exp: 'item', 'item[field] contains year' | sort: 'date' -%}
adding that will actually sort them based on your date field (keep in mind, it is not parsing the dates, just sorting them alphabetically, which will work if your dates are yyyy-mm-dd, but won't work if they are say yyyy-m-d or d-m-yyyy).
By default, it is not sorting by objectid, it is just the order in the CSV (so more or less sorting by the index number in the spreadsheet).