{% 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 or changed to their new values
Syntax: {% query_param_link [variable_to_save_to =] parameter1:value [parameter2:'etc...'] %}

If you include variable to save the new link to, it will not output anything to the page. Otherwise it will output the link directly to the page.

This tag will accept any number of parameters and evaluate them before replacing them in the URL.

Output
Original URL: "http://www.domain.com/path/to/page" Template: <a href="{% query_param_link page:2 %}">Page 2<a> Output: <a href="http://www.domain.com/path/to/page?page=2">Page 2<a> Original URL: "http://www.domain.com/path/to/page?page=2" Template: {% assign numLinks = 3 %}{% query_param_link mylink = page:1 limit:numLinks topic:'Patriotism' %}<a href="{{ mylink | Append:"#articletop" }}">Top {{ numLinks }} Patriotic Articles<a> Output: <a href="http://www.domain.com/path/to/page?page=1&limit=3&topic=Patriotism#articletop">Top 3 Patriotic Articles<a>