This PR adds an optional priority field for items. This field controls how items are ordered on the front/tag pages. Items without a priority field are sorted below all items that do have a priority field. Currently, lower priority numbers sort higher up on the page.
This works by first sorting the array of items as described above, and then taking advantage of Masonry's horizontalOrder option to keep higher priority elements at the top while still fitting things together in an optimal way.
To test, try setting the priority of items in items.js in different ways and make sure the items are sorted on the page(s) the way you'd expect. Try this on both the front page and the item pages. Browser reload may be required after changing items.js.
This PR adds an optional
priority
field for items. This field controls how items are ordered on the front/tag pages. Items without apriority
field are sorted below all items that do have apriority
field. Currently, lower priority numbers sort higher up on the page.This works by first sorting the array of items as described above, and then taking advantage of Masonry's horizontalOrder option to keep higher priority elements at the top while still fitting things together in an optimal way.
To test, try setting the priority of items in
items.js
in different ways and make sure the items are sorted on the page(s) the way you'd expect. Try this on both the front page and the item pages. Browser reload may be required after changingitems.js
.