Filter product collection loop with featured products and custom frontmatter

You have also called your collection products and your data products which is confusing.

As the first is accessed as

site.products

And the other as

site.data.products

And if you do have blog posts they are under

site.posts

Break out your where filter to see what is going on there.

Here I leave out the filter and just get one item and view its data.

{% assign product = site.products | first %}
- Title {{ product.title }}
- Name {{ product.name }}
- Featured: {{ product.featured }}
- {{ product | inspect }}

The last will show you all your fields as keys and values

Also remember to set booleans without quotes in YAML

---
featured: true
---
1 Like