Please Help Boundless multiple filters

Highlighted
Explorer
67 0 10

Hi, 

 

I am trying to include multiple filters in the boundless theme. For now I have managed to group tags and have one filter for each group, but they don't work together... Would really appreciate your help!! Here is the snippet I am including:

 

{% if template contains 'collection' and collection.all_tags.size > 1 %}
  
  <!-- A recursive loop to catch and filter out the different tag categories -->
  {% assign c = 0 %} 
  {% for t in collection.all_tags %}
  {% capture cat %}{{ cat }}{% capture temp_cat %}{% if t contains '_' %}{% assign cat_grp = t | split: '_' %}{{ cat_grp.first }}{% endif %}{% endcapture %}{% unless cat contains temp_cat %}{% if t contains '_' %}{% assign new_cat_grp = t | split: '_' %}{{ new_cat_grp.first }}{% endif %}{% unless forloop.last %}+{% endunless %}{% assign c = c | plus: 1 %}{% endunless %}{% endcapture %}
  {% endfor %}
  
  <!-- create array of tag categories -->
  {% assign cat_array = cat | split: '+' %}
  <div class="action-bar-secondary">
  <!-- loop through tag categories -->  
  {% for i in cat_array %}
  <!-- ignore if tag category is empty -->  
  {% unless i == '' %}

  <div class="action-bar-secondary__dropdown action-bar-secondary--right" style="padding-right:20px">
   
    <label for="{{ i }}"></label>
      <select name="{{ i }}Tags" id="{{ i }}Tags" aria-describedby="a11y-refresh-page-message a11y-selection-message" onchange="location = this.value;">

<!-- this shows "all" products option -->  

       {%- if current_tags -%}
       	  <option value="{{ collection.url }}">{{ 'collections.general.all_tags' | t }}</option>
       {%- else -%}
          <option value="">{{ }}</option>
       {%- endif -%}        
        
        
      <!-- loop through collection tags -->  
	  {% for t in collection.all_tags %}
	  <!-- if tag contains the category title -->
	  {% if t contains i %}
	  <!-- strip out tag category prefix and add/remove link for tag filtering -->
         {%- assign ftag_url = t | link_to_tag: t | split: 'href="' | last | split: '"' | first -%}                 
	      <option value="{{ ftag_url }}"{% if current_tags contains t %} selected="selected"{% endif %}>{{ t | remove: i | remove: '_' }}</option>
        {% endif %}       
	  {% endfor %}
    </select>  
  </div>
  {% endunless %}
  {% endfor %}
</div>
  {% endif %}
0 Likes