Search code examples
shopifyshopify-appshopify-template

Adding section to shopify theme template


These are the section I added

{% section 'single-product-hero' %}
{% section 'promise' %}
{% section 'product-content' %}
{% section 'faq' %}
{% section 'rich-text' %}
{% section 'icon-with-text' %}
{% section 'icon-with-text' %}
{% section 'icon-with-text' %}

The icon-with-text section is displaying the same section content. When I customize the content of one of the three sections, the other two also get updated too. How can I fix it?


Solution

  • This is because static sections share their settings across the whole store:

    You can include a statically-rendered section in multiple theme files. However, only one instance of the section exists. If you change section settings in one location, then the change will be applied to all locations where the section is rendered.

    From: Statically render a section

    You need to change your template to JSON and implement dynamic sections (which are the same, just template changes)

    Just checked to confirm - with 2.0 page I was able to add two exact same sections on the given page and apply different settings to them.