I'm trying to get an archive to work on a web page, based on entries per year. This, in combination with an isotope-like filtering of categories. I want to output entries based on year, and then output the categories attached to these posts to use for the filtering. I've managed to get the year sorting to work by using Low Yearly Archives, but I can't add a year parameter in the categories tag.
The code that outputs the categories looks like this:
{exp:channel:categories style="linear" channel="News" category_group="1" dynamic="no" show_empty="no"}
<li><a class="filter" data-filter="{category_name}">{category_name}</a></li>
{/exp:channel:categories}
And the code that outputs the entries looks like this:
{exp:channel:entries channel="News" dynamic="no" limit="12" year="{segment_2}"}
{title}
{/exp:channel:entries}
This takes the segment_2 from the url which low yearly archives outputs.
Now, the categories outputs all categories from all years, not the one from segment_2. If only the channel category tag had accepted a year parameter, this would have been solved. Any idea how to solve this? I've tried combining channel category and channel entries tags, but I can't get the combination to work.
Edit: I've tried the following:
{exp:channel:entries channel="News" dynamic="no" limit="12" year="{segment_2}"}
<li><a class="filter" data-filter="{categories}{category_name}">{category_name}{/categories}</a></li>
{/exp:channel:entries}
And although this outputs the categories assigned to the corresponding posts, I get duplicates. So I need to output unique ones.