Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I've created filter tags for blog posts by inserting this code below in main-blog-liquid:
{% if blog.tags.size > 0 %}
<div class="blog-filter">
<div class="list-group">
<ul id="BlogTagFilter" class="tag-list">
<li>Filter by:</li>
<li>
<a href="{{ blog.url }}" class="button">
{{ 'All Topics' }}
</a>
</li>
{% for tag in blog.all_tags %}
<li>
<a href="{{ blog.url }}/tagged/{{ tag | handleize }}" class="button">
{{ tag }}
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
Underneath this piece of code:
{%- paginate blog.articles by 6 -%}
<div class="main-blog page-width section-{{ section.id }}-padding">
<h1 class="title--primary">{{ blog.title | escape }}</h1>
However when a filter tag is selected (e.g "How-to guides") the page refreshes and the user is scrolled to the top of the page when the filter is applied.
Is there a way to edit this code so when the filter is clicked the user isn't scrolled to the top of the page or the filter is applied with no whole page refresh and scroll.
Thanks,
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024