Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hey There,
I am working on trying to get the {{ filter_value.label }} out of the filter
{%- for filter_value in filter.active_values -%}
{%- assign filter_count = filter_count | plus: 1 -%}
<a class="filter__active__remove" href="{{ filter_value.url_to_remove }}" data-filter-reset-button>
{{ filter_value.label }}
<span class="filter__x">✕</span>
</a>
<script type="text/javascript">
var filterLabel = "{{ filter_value.label }}";
console.log(filterLabel);
</script>
{%- endfor -%}
Currently, I am trying to console.log() the output to confirm the logic works, but for some reason I cant get updates on the page after initial load. im assuming this is form so I would have expected it to run the script again after something is selected.
any ideas? Also, where is the filter active stored? I lookied in localstorage, but couldnt find it.
Hello @Chris_Sydney ,
Can you please provide more details about this? Which theme you are using, The store URL, and why do you want to get the {{ filter_value.label }} out of the filter?
Sorry Its in a sanbox at the moment.
I want to get that value out of the filter, so I can use it in the header title.
IE: instead of having multiple collections, where a customer needs to navigate to another /collection/X to see different items, I wanted to take them to collections/all and then control the header title and image via the filter.
I only have 4 options that I want to filter against, so really only 4x4. = 16 different header names and images for header image.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025