All things Shopify and commerce
When I am in a Product template, I am able to add blog posts. Set quantities, pick the post, no problem.
However, I want to do this through metafields.
When I go to the blog posts, I see I can connect a dynamic source, but when clicking on this, I don't have anything.. which I understand, because I need to set those up.
However, when I create a metafield, I don't see a way to connect it to the blog posts. Am I missing something?
Based on the information provided in the search results, it seems that currently there is no direct way to link blog posts to products using metafields in Shopify.
A few key points:
1. Shopify's metafields allow adding custom fields to products, collections, orders, customers, etc. However, there is no built-in "blog post" metafield type that would allow directly linking a blog post.
2. When creating metafields, the option to reference or link to a specific blog post is not available in the metafield definition settings.
3. In March 2023, Shopify released the ability to use dynamic sources on blog posts and articles, allowing theme files to connect to metafields.However, this is for displaying custom metafield data on the blog post itself, not for linking the blog post to a product.
4. As a workaround, I would suggest:
- Creating a text metafield on the product to store the blog post's handle
- Adding a metafield to the blog post containing the product ID
- Then using Liquid code to loop through blog posts and render ones that match the product's stored blog handle or ID.
5. But there is no streamlined way to set this up directly through the Shopify admin metafield settings for products and blog posts.
In summary, the built-in metafields do not currently support a "blog post" reference type to easily link products and posts. The capability to connect dynamic sources to blog post templates is a recent addition, but does not address linking to products. Workarounds using Liquid code are possible but require more manual setup.
Was this helpful? Like or Accept solution - Buy me a coffee ☕️
- Contact me: Xipirons | WhatsApp
- Shopify Developer based in France, helping online merchants succeed
Can't really accept it as a "Solution", but it does answer my question.. Too bad it isn't possible (yet).
You could possibly do it in reverse. Not ideal but works. You add a metafield to your blog post pointing to the product/s you would like it to feature on and then loop through blog posts where the metafield matches the current product.
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024