Hi,
We want to be able to pull in the content from a particular blog on to a product page (the example being in-depth product reviews, written as blog posts, which then we want to pull into the corresponding product detail pages).
Loading the content of one static blog as a proof-of-concept was pretty straightforward:
{% assign article = articles['news/post-handle-here'] %}
{{ article.content }}
However, making that dynamic is proving tricky… My intention was to use a product metafield which contains the handle of the blog I want to pull, but I can’t find a way to drop that into the articles object in a way it can read.
Dropping a metafield within the articles object in any form always results in a liquid error due to unexpected characters.
I’ve tried saving the entire articles string (as in, the full object with the relevant blog handle) in the metafield to get around that, but the article object doesn’t seem to be able to parse it:
{% assign article = product.metafields.custom.product_blog %}
{{ article.content }}
Does anyone have any suggestions or ideas on what would get this working?
Thank you,
Ash