Get length of selected items in templated filter when some items have commas

  1. I want to base some of my html parameter logic on selected values in a filter.
  2. My original thought was using the following
 {% if _filters[‘field_name.view_name']  | split: "," | size > 1 %} 
    ‘Do something’ 
{% else %} 
    ‘Do another thing’ 
{% endif %}
  1. However, some of my items in the filter have commas, resulting in 1 extra array item (and count) for each item with a comma.

Any folks have any thoughts?

1 Like