Hello @BA_chloe ,
I have updated the code and fixed the issue with the quick add.
If you want to show products in a blog post, follow these steps:
- Go to Dashboard → Settings → Custom Data → Blog Posts. Click Add Definition, enter the name (e.g., Products), select the type as Products, choose the list of files, and save it.
- Go to Online Store → Edit Code, search for the file main-article.liquid, and replace all the code above with the new code. Save it.
Navigate to Online Store → Blog Posts, select the blog post where you want to display the products, go to Metafields, and select the products you want to display.
{{ 'component-card.css' | asset_url | stylesheet_tag }}
{{ 'component-price.css' | asset_url | stylesheet_tag }}
{% if section.settings.image_shape == 'blob' %}
{{ 'mask-blobs.css' | asset_url | stylesheet_tag }}
{%- endif -%}
{%- if section.settings.quick_add == 'standard' -%}
{%- endif -%}
{%- unless section.settings.quick_add == 'none' -%}
{{ 'quick-add.css' | asset_url | stylesheet_tag }}
{%- endunless -%}
{{ 'section-blog-post.css' | asset_url | stylesheet_tag }}
{% schema %}
{
"name": "t:sections.main-article.name",
"tag": "section",
"class": "section",
"blocks": [
{
"type": "@app"
},
{
"type": "featured_image",
"name": "t:sections.main-article.blocks.featured_image.name",
"limit": 1,
"settings": [
{
"type": "select",
"id": "image_height",
"options": [
{
"value": "adapt",
"label": "t:sections.main-article.blocks.featured_image.settings.image_height.options__1.label"
},
{
"value": "small",
"label": "t:sections.main-article.blocks.featured_image.settings.image_height.options__2.label"
},
{
"value": "medium",
"label": "t:sections.main-article.blocks.featured_image.settings.image_height.options__3.label"
},
{
"value": "large",
"label": "t:sections.main-article.blocks.featured_image.settings.image_height.options__4.label"
}
],
"default": "adapt",
"label": "t:sections.main-article.blocks.featured_image.settings.image_height.label"
}
]
},
{
"type": "title",
"name": "t:sections.main-article.blocks.title.name",
"limit": 1,
"settings": [
{
"type": "checkbox",
"id": "blog_show_date",
"default": true,
"label": "t:sections.main-article.blocks.title.settings.blog_show_date.label"
},
{
"type": "checkbox",
"id": "blog_show_author",
"default": false,
"label": "t:sections.main-article.blocks.title.settings.blog_show_author.label"
}
]
},
{
"type": "content",
"name": "t:sections.main-article.blocks.content.name",
"limit": 1
},
{
"type": "share",
"name": "t:sections.main-article.blocks.share.name",
"limit": 2,
"settings": [
{
"type": "text",
"id": "share_label",
"label": "t:sections.main-article.blocks.share.settings.text.label",
"default": "t:sections.main-article.blocks.share.settings.text.default"
}
]
}
],
"settings": [
{
"type": "header",
"content": "t:sections.featured-collection.settings.header_collection.content"
},
{
"type": "range",
"id": "columns_desktop",
"min": 1,
"max": 6,
"step": 1,
"default": 4,
"label": "t:sections.featured-collection.settings.columns_desktop.label"
},
{
"type": "header",
"content": "t:sections.featured-collection.settings.header.content"
},
{
"type": "select",
"id": "image_ratio",
"options": [
{
"value": "adapt",
"label": "t:sections.featured-collection.settings.image_ratio.options__1.label"
},
{
"value": "portrait",
"label": "t:sections.featured-collection.settings.image_ratio.options__2.label"
},
{
"value": "square",
"label": "t:sections.featured-collection.settings.image_ratio.options__3.label"
}
],
"default": "adapt",
"label": "t:sections.featured-collection.settings.image_ratio.label"
},
{
"type": "select",
"id": "image_shape",
"options": [
{
"value": "default",
"label": "t:sections.all.image_shape.options__1.label"
},
{
"value": "arch",
"label": "t:sections.all.image_shape.options__2.label"
},
{
"value": "blob",
"label": "t:sections.all.image_shape.options__3.label"
},
{
"value": "chevronleft",
"label": "t:sections.all.image_shape.options__4.label"
},
{
"value": "chevronright",
"label": "t:sections.all.image_shape.options__5.label"
},
{
"value": "diamond",
"label": "t:sections.all.image_shape.options__6.label"
},
{
"value": "parallelogram",
"label": "t:sections.all.image_shape.options__7.label"
},
{
"value": "round",
"label": "t:sections.all.image_shape.options__8.label"
}
],
"default": "default",
"label": "t:sections.all.image_shape.label"
},
{
"type": "checkbox",
"id": "show_secondary_image",
"default": false,
"label": "t:sections.featured-collection.settings.show_secondary_image.label"
},
{
"type": "checkbox",
"id": "show_vendor",
"default": false,
"label": "t:sections.featured-collection.settings.show_vendor.label"
},
{
"type": "checkbox",
"id": "show_rating",
"default": false,
"label": "t:sections.featured-collection.settings.show_rating.label",
"info": "t:sections.featured-collection.settings.show_rating.info"
},
{
"type": "select",
"id": "quick_add",
"default": "none",
"label": "t:sections.main-collection-product-grid.settings.quick_add.label",
"options": [
{
"value": "none",
"label": "t:sections.main-collection-product-grid.settings.quick_add.options.option_1"
},
{
"value": "standard",
"label": "t:sections.main-collection-product-grid.settings.quick_add.options.option_2"
},
{
"value": "bulk",
"label": "t:sections.main-collection-product-grid.settings.quick_add.options.option_3"
}
]
},
{
"type": "header",
"content": "t:sections.featured-collection.settings.header_mobile.content"
},
{
"type": "select",
"id": "columns_mobile",
"default": "2",
"label": "t:sections.featured-collection.settings.columns_mobile.label",
"options": [
{
"value": "1",
"label": "t:sections.featured-collection.settings.columns_mobile.options__1.label"
},
{
"value": "2",
"label": "t:sections.featured-collection.settings.columns_mobile.options__2.label"
}
]
},
{
"type": "header",
"content": "t:sections.all.padding.section_padding_heading"
}
],
}
{% endschema %}
Copy
- Go to Online Store → Customize → Blog Posts, go to the blog post settings, and configure the settings as desired.
Important Note: This code has been provided according to the Dawn theme and is based on Dawn theme version 15.3.0.