sort_order

Sort results by selected attribute

Accepted values: varies by content type

Content types: All

Related settings: sort_search_results

data-options="id=123
/live/json/events

Default behavior

By default, event listings always show upcoming chronological results (use start_date and end_date to access past results). All other types default to sorting first by balloons and then alphabetically.

Possible values

Description Value
Oldest to top date
Newest to top reverse-date
Oldest to top (time only) time
Newest to top (time only) reverse-time
A-Z alphabetical
Z-A reverse-alphabetical
Random random
Random (no JavaScript, see below) random-nojs
Most tags matched most-tags-matched
Profiles: Any configured profile field profiles_#

Randomizing your widget results

When you set sort_order=random, LiveWhale will load and cache more results than are actually being displayed and use JavaScript code on load to randomly show a few of those – this allows an immediate randomization for users even if they refresh within the 5min cache window. If you’re using clean markup, LiveWhale will also add an additional container <div> in order to hold the calculated random results.

To bypass this “immediate” randomization effect and use only your specific clean HTML markup, you can use sort_order=random-nojs to just load into the page and widget cache a random set of results which may take a few minutes to refresh on the front-end.

Sorting by most tags matched

When you are matching multiple tags with tag_mode=any, you can use sort_order=most-tags-matched and results matching more of your requested tags will be put highest in the results order.

Sorting search results

By default, when you use the search setting, results will always be sorted by search ranking. More about how LiveWhale calculates search results can be found in the docs. However, if you want to specifically sort search results by some other criteria, you can set sort_search_results=true.

Configuring a custom sort order

While LiveWhale widgets come with a variety of sort methods, there are occasions when you’ll need a custom sort method to meet a specific need – for instance, profile fields are all sorted ascending, and maybe you’ll have one them you want to sort descending. Instructions for adding a custom sort order.

Common Settings

All Settings