Accessing second element in 'collection.filters' in liquid

Hi,

I need to access the values of a specific filter in liquid on a collection page. I can access the first element like this:

{%- assign filters = collection.filters -%}
{%- assign first_filter = filters.first -%}

But I can’t find a way to access the second one, this doesn’t work:

{%- assign filters= collection.filters -%}
{%- assign second_filter = filters[1] -%}

Is there a way to do it?

1 Like