I have an archive page that shows current year events. In the same page users can click and view the previous events by a taxonomy list (2017, 2016, etc).
Now in my twig template I have this:
{% if uri.param('year') %}
{% set year = uri.param('year') %}
{% set collection = page.collection() %}
{% else %}
{% set year = "now"|date("Y") %}
{% set collection = page.collection().dateRange('01/01/' ~ year, '12/31/' ~ year) %}
{% endif %}
But when I call pagination number:
{% if config.plugins.pagination.enabled and page.collection.params.pagination %}
{% include 'partials/pagination.html.twig' with {'pagination':page.collection.params.pagination} %}
{% endif %}
page.collection.params.pagination
does not contain year
param.
I could add a default param in url like this:
mydomain/events/year:<current year>
How can I define a “default” param for a page?
Thanks