How can I display specific articles on product pages?

Hi, I’m trying to put a specific article on a product page. How do I do it? I’m trying to do it using metafield, but there’s no meafield for articles on products metafield.

Example. On Car products, I would like to show the articles for Cars. And for truck products I would like to show Truck article. I can’t do it using creating new templates because I have many products & blogs.
P,S, Articles not Blogs. articles inside a blog.

Hello @vcarza ,

Here is our suggestions:

Go to Online Store → Theme → Actions → Edit code

Go to Sections → product-template.liquid (or something similar) → Add the following code:

{% assign article_handle = 'your-article-handle' %}
{% assign article = blog.articles[article_handle] %}
{% if article %}
## {{ article.title }}
{{ article.content }}
{% endif %}

Save and preview.

Hope this can work.

Ali Reviews team.

Use this code :

{%- assign blog = blogs[‘blog-handle’] -%}
{%- if blog.articles_count > 0 -%}
{%- for article in blog.articles -%}
{% if article.handle == ‘blog-handle/article-handle’ %}

{{ article.title }}

{{ article.content }} {% break %} {% endif %} {% endfor %} {% endif %}

How can I do this, if like I want to add 3 articles per product.

Is there an app for this? Like automated app, for example if the article is tagged with cars, it will show on products with a tag of cars too

Also implement custom logic for blog-product mapping.

Do you have knowledge of basic HTML?

  1. Go to Online Store
  2. Edit Code
  3. Find main-product.liquid file
  4. Add the following code where you want to display blog

Use this code : this code display first 3 articles

{%- assign blog = blogs[‘blog-handle’] -%}
{%- if blog.articles_count > 0 -%}
{%- for article in blog.articles limit:3-%}

{{ article.title }}

{{ article.content }}

{% endfor %}
{% endif %}