A space to discuss online store customization, theme development, and Liquid templating.
Current theme: Local
I added the following code to create a filter for blogs
{%- for tag in blog.all_tags -%} <a class="button button--small {% if current_tags contains tag %} button--solid {% else %} button--outline {% endif %}" href="{{ blog.url }}/tagged/{{ tag | handleize }}" > {{ tag | capitalize }} </a> {%- endfor -%}
I also tried {{ tag.handle }} instead of {{ tag | handleize }}
However blogs aren't filtered as intended, I searched for JavaScript code that could affect the filter's functionality but didn't find any
When I headed to navigation I saw this message "The current theme doesn’t support filters. " however after searching it should not affect the blogs filter it's only for the products filter and I ensured the URL format was working by trying the same URL on an old theme where the blogs got filtered correctly
Are there any other steps to take in order to debug this issue?
Is your article loop wrapped in a paginate object?
Hello Matthaigh, I reverted to an older theme version and it fixed the issue but I'd still like to know how paginate can affect the filter of the article. Yes it was wrapped in paginate object
Hi Hiba
This was the snippet I used to get the tags to render in a list with links to add/remove.
I've had also specified which blog the tags are associated with "blogs.recipes.all_tags".
This snippet sits inside pagination.
<ul>
{% for tag in blogs.recipes.all_tags %}
{% if current_tags contains tag %}
<li class=" active">{{ tag | link_to_remove_tag: tag }}</li>
{% else %}
<li>{{ tag | link_to_add_tag: tag }}</li>
{% endif %}
{% endfor %}
</ul>