{% query_param_link %}

This tag saves or outputs a link to the current page as it was loaded except with the specified query parameters added, removed, or changed to their new values


Syntax: {% query_param_link [[var|set|assign] new_variable_name =] parameter1:value [parameter2:'etc...'] %}

This tag will either save the link to a variable or output it to the page, depending on if you have specified a variable to save the link to.

If you are assigning the link to a variable and do not specify one of "var", "set", or "assign", then the "var" behavior will be used - which is to save the result on the current scope. If new_variable_name starts with '&', will attempt to assign the value by reference.

This tag will accept any number of parameters and evaluate them before replacing them in the URL. You may also include reference variables, which will be dereferenced into their parameter names.

To remove a query parameter from the URL, set it to false (parametername:false).


Query Param Link

Original URL: "http://www.domain.com/path/to/page" Template: Page 2 Output: Page 2
Original URL: "http://www.domain.com/path/to/page?page=2" Template: {% var numLinks = 3 %} {% query_param_link mylink = page:1 limit:numLinks topic:'Patriotism' %} Top {{ numLinks }} Patriotic Articles Output: Top 3 Patriotic Articles
Original URL: "http://www.domain.com/path/to/page?flat=true" Template: {% var oldvarname = 'flat' %} {% var newvarname = 'round' %} Output: