Skip to main content

first

array | first

Returns the first item in an array.

{%- assign first_product = collection.products | first -%}

{{ first_product.title }}

Output

Blue Mountain Flower

You can use the first filter with dot notation when you need to use it inside a tag or object output.

{{ collection.products.first.title }}

Output

Blue Mountain Flower
Was this page helpful?