All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Sorting table headings

Paul Cripps 25 Apr 2014 16:17 question, complete

We have a results page where the results are displayed in tables. We'd like to sort and order by these tables and results.

This initially works using:

''''
Location
''''

but we would like to toggle the sort direction, so it would be great to have something like this:

''''
Location
''''

Is this possible? We notice manually changing the URLs this works:

example.com/results?collection=my-channel&keywords=test&orderby=location&sort=asc

example.com/results?collection=my-channel&keywords=test&orderby=location&sort=desc

Whats we'd like it to simply click each table heading and toggle the sort direction..?

Replies

  1. Low 25 Apr 2014 17:41

    You should be able to use the URL tag for this. It will inherit the GET query, and any parameters set to the tag will override the existing query, so:

    {exp:low_search:url sort="asc"} 
    {exp:low_search:url sort="desc"}