I’m trying to create a post filter that works with my particlular blog listing template.
My blog grabs specified tag content (there’s other content we don’t want to show)
{% set contents = blog_recent_tag_posts('default', 'News,Events,Articles', 99) %}
This works fine but I’d like to reload the content on the basis of filtering by a tag.
I’ve tried to create a conditional that checks for the tag name and reloads the content, in this case the ‘News’ posts, but this just reloads all the same content, even though the url slug changes accordingly to /tag/news
{% set contents = blog_recent_tag_posts('default', 'News,Events,Articles', 99) %}
{% if tag.name == "News" %}
{% set contents = blog_recent_tag_posts('default', 'News', 99) %}
{% endif %}
@DM2 I’m guessing there’s a reason why you’re not using the standard blog template that already includes this functionality? Anyway, nice work on finding a solution that works for you.
yes, it’s a very heavily customised template I’ve inherited, having said that I just dragged in the post filter module and it worked fine…it didn’t before! That’s obviously the best way of doing it.