skip to Main Content

I am working on a custom Shopify theme and I got stuck here and I don’t know the reason behind it. This schema is not showing up at all. I have 9 other schemas and they all work find.
Your help is really appreciated if you can figure out what is wrong and why not showing up in the front admin panel in order to add content.

Thanks;

{% schema %}
        {
            "name": "product FAQ page",
            "settings": [
                {
                    "type": "text",
                    "id": "faq",
                    "label": "Product",
                    "default": "content"
                }
            ]
        }

    {% endschema %}

3

Answers


  1. The schema itself looks normal, and if Shopify allows you to save that file in the theme editor it means that Shopify considers your schema valid. If the settings are not showing up in your theme-customization admin panel, it probably means that Shopify doesn’t think that the above section is relevant to the page you’re looking at in the theme customizer.

    Two things to check:

    • Have you remembered to include your section somewhere in your site? (Using {% section 'my-section-name' %}, double-checking for typos)
    • When trying to edit your settings for the section, are you currently looking at a page that includes that section?

    I’m assuming that you’re not expecting this to appear as a section that you can add dynamically to the Index page – but if you are making a dynamically-included section, remember that you need to include at least one preset in the schema data (See https://help.shopify.com/en/themes/development/sections#static-and-dynamic-sections for Shopify’s documentation on dynamic sections)

    Login or Signup to reply.
  2. In order to add dynamic sections you should include a preset configuration so that it appears on the “add sections” editor

    {% schema %}
        {
            "name": "product FAQ page",
            "settings": [
                {
                    "type": "text",
                    "id": "faq",
                    "label": "Product",
                    "default": "content"
                }
            ],
            "presets": [
                {
                    "name": "section name",
                    "category": "custom section"
                }
            ]
        }
    
    {% endschema %}
    

    for the static section, you could simply add {% section ‘my-file-name’ %}

    Login or Signup to reply.
  3.     You just need to set the preset for the same 
        
        {% schema %}
            {
                "name": "product FAQ page",
                "settings": [
                    {
                        "type": "text",
                        "id": "faq",
                        "label": "Product",
                        "default": "content"
                    }
                ],
                "presets": [
                    {
                        "name": {
                               "en": "Add FAQ Section"        
                         }
                    }
                ]
            }
        
        {% endschema %}
    

    Note: Go to the customize theme option , from left side options you will find the button "Add Section" click on that you will have the section "Add FAQ Section" click on that it will be there on the page.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search