Adding product reccomendation to blog post

Hi, i notice that on blogpost in the shopify admin you can add metafields as im trying to add product reccomendations to my blog post.

i have created the metafield however when i go on the blog and click add block there ther is nothing there. i have also added this pice of code in the article.liquid file below the content and still nothing.I found this code on logeix and tried some other code but nothing seems to be working.

{% assign feature_products = article.metafields.custom.blog_post.feature_products.value %}

{% for product in collections.feature_products.products %}

{{ feature_products.count }}

{{ product.title }}

{{ product.price | money }}

{% endfor %}

Hi @sam163 For saner control make sure to check the theme editor for a recommended products sections and whether or not you can control the recommendations for the blog in the Search & Discovery App

https://help.shopify.com/en/manual/online-store/search-and-discovery

i have created the metafield however when i go on the blog and click add block there ther is nothing there. i have also added this pice of code in the article.liqui

Blocks are not magic you cannot just add arbitrary code and expect a block to appear in the theme editor.

Themes settings have a specific structure

https://shopify.dev/docs/themes/architecture/sections/section-schema#blocks

For this:

{% assign feature_products = article.metafields.custom.blog_post.feature_products.value %}

You need to step through it to ensure the syntax is right and it contains what you expect it to.

From your description that metafield is a product list so you have to loop over the entries.

https://shopify.dev/docs/apps/custom-data/metafields/types

Try outputting it directly, use a custom liquid block/section for saner testing loop.

{% assign feature_products = article.metafields.custom.blog_post.feature_products.value %}
value: {{ feature_products}}

{% assign feature_products = article.metafields.custom.blog_post.feature_products.value %}
value JSON: {{ feature_products | JSON }}

{% assign feature_products = article.metafields.custom.blog_post.feature_products %}
metafields.custom.blog_post.feature_products JSON {{ feature_products}}

Or seeing the numerous pre-existing posts on troubleshooting metafields.

If you just need services to get this customization finished then contact me by my email .
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.