So, I’m trying to find a way to exclude posts with a specific tag from being listed around the site - I want these posts listed only on particular pages. While I thought that I had achieved this with various #get filters in my theme, I have run into a recurring issue with (I thought) pagination. It just repeats the same list of posts, rather than getting the next (25) ones. I looked into it, and found that the actual /page/# page was returning these repeated results.
After a bit of comparing my somewhat modified Casper theme with the default Casper theme, and testing various changes, I found that the error arose when I used the get helper. For instance, in my authors.hbs, I have this:
{{#get "posts" filter="primary_author:{{slug}}+tags:-[hash-secrets,hash-secret,podcast]"}}
{{#foreach posts}}
{{> "post-card"}}
{{/foreach}}
{{/get}}
So the get helper doesn’t support pagination… Fine, and ok. At first, I tried various attempts at using other helpers like ‘has’ but I couldn’t get it working within the foreach iterator (the handlebars documentation more or less says that this won’t work).
Fine again! I’ll just remove the get filter, and use routes.yaml to do the filtering; it’s a cleaner method anyways. This works fine for pages in collections and anywhere that I have things routed via channels, but the problem is that I cannot filter within taxonomies or dynamically channel to taxonomies using {slug}… right? Unlike the use case here, I do not have a clear use case for channels which fixes my problem… at least not without creating a channel for every author and tag page in existence. No problem if it’s just authors, but tags-- well, to my chagrin, the other authors on the site seem to have no restraint for creating new tags.
So, currently, everything is fine except my author and tag taxonomies, which are still using the #get method above and thereby don’t have pagination.
What am I missing? Any suggestions? Maybe I’m just asking too much? If it’s not possible to filter within taxonomies, I’ll likely just remove the whole /tag taxonomy, and create channels for each of my author pages.