How can I let the user activate a particular SuperSort filter ***I have just realised I am mixing up my filtering and sorting. I have amended the question to try and make it a bit clearer.

I'm trying to use SuperSort plugin to run different filters, but I'm struggling as only the last filter gets applied. I would like to add the filter to a button or link, so that when the user clicks on it, it activates the filter. Any tips?

&lt;h1&gt;search&lt;/h1&gt;

&lt;form action="{{ url('search') }}"&gt;
    &lt;input type="search" name="q" placeholder="Search"&gt;
    &lt;input type="submit" value="Go"&gt;
&lt;/form&gt;

{% set query = craft.request.getParam('q') %}
{% set users = craft.users.search(query).order('dateUpdated')|reverse %}

{% if users|length %}
    &lt;p&gt;&lt;/p&gt;
    &lt;ul&gt;
        &lt;span&lt;a href="{{ users.dateUpdated }}"&gt;{{ users|length }} results:&lt;/a&gt;&lt;/span&gt;
        &lt;li&gt;&lt;a href="{% set usersByFirstName = craft.users.search('sortAS', '{{ firstName}}') %}"&gt;A-Z&lt;/a&gt;&lt;/li&gt;

        &lt;li&gt;&lt;a href="{% set users = craft.users.search(query).order('firstName')|reverse%}"&gt;Z-A&lt;/a&gt;&lt;/li&gt;

        &lt;li&gt;&lt;a href="#"&gt;Nearby&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;Newest&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;Oldest&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
{% endif %}


For example: 

link#1 - sort A-Z
link#2 - sort dateUpdated
So in order to do this you have to reformat your code and your strategy a bit. You cant provide a Craft query as a link, all that does is grab an array from the database and it won't inherently print something out.

&lt;li&gt;&lt;a href="{% set usersByFirstName = craft.users.search('sortAS', '{{ firstName}}') %}"&gt;A-Z&lt;/a&gt;&lt;/li&gt;


The best way to change the way your results are being sorted (if you want to do it via Twig and not something front-end like JS is to send the sort style through a query string.

So let's assume you are returning a list of users and you want to sort them by first name alpha ascending:

{% set users = craft.users.order('firstName asc').find() %}


If you want to change the direction of the order create a link like this:

&lt;a href="url/user-list?sort=desc"&gt;Sort Z-A&lt;/a&gt;


When the page reloads a new query parameter is available to you sort, you can get it with this code:

{% set sort = craft.request.getParam('sort') %}


Now you can use that variable to alter the way your original query works. Something like this... starting over from scratch:

{% if craft.request.getParam('sort')|length &gt; 0 %}

    {% set sort = craft.request.getParam('sort') %}

 {% else %}

    {% set sort = 'asc' %} {# default sort #}

 {% endif %}


Then in the Craft query, you could just user this instead of our original query above:

 {% set users = craft.users.order('firstName ' ~ sort).find() %}


Now when the page first loads you will get users sorted by firstName asc and when you click the filter it will reload with firstName desc.

You can apply this same query string method to all of the parameters. Getting variables like:

{% set sortBy = craft.request.getParam('sortBy') %}


Where sortBy equals firstName or lastName

That query string would look like:

url/user-list?sort=desc&amp;sortby=firstName


And so on.