Hi. I'm a relative newbie putting together a simple theme for personal use.
I have a loop which gets all the years of pages:
{% for page in pages.children.visible.order('date', 'desc') %}
{% set year = page.date|date('Y') %}
{% endfor %}
but I'm not sure how to get just the unique years from this array. I'm sure I need to use the array_unique Twig function - but I'm not sure exactly how.
Could someone help me out please?
Thank you.