I want to have recipe blogs on my site and I want each recipe to have the products that I used from my shop.
i made a meta field in blog posts of type product list
Im trying to add it in the template of my blog posts with liquid but the product list doesn’t seem to get rendered
I added this in main-article.liquid
{% if article.metafields.custom.ingredients %}
### Ingredients
{% for product_id in article.metafields.custom.ingredients %}
{% assign product_id_cleaned = product_id | remove: "gid://shopify/Product/" %}
{% assign product = all_products[product_id_cleaned] %}
{% if product %}
- {{ product.title }}
{% else %}
- Product not found
{% endif %}
{% endfor %}
{% else %}
No ingredients metafield found for this article.
{% endif %}
All it shows in the front end is “Ingredients” and an empty list
Where am I going wrong?