DEV Community

Qrolic Technologies
Qrolic Technologies

Posted on

How to create a section with a customized option?

Follow this tutorial to create a section with a customize option in Shopify.

  1. Log in to your Shopify admin panel and navigate to the Section folder.
  2. Click on the Add a new section link.
    Alt Text

  3. Add a section name and hit the Create Section button.
    Alt Text

  4. Add a dynamic image in your section.

You can view all your schema type from here

Now add the following code in grid-box.liquid file:

{% schema %} 
  { 
    "name": "Grid Box", 
    "settings": [{
           "type": "image_picker", 
           "id": "image", 
           "label": "This is image picker" 
        }] 
  } 
{% endschema %} 
Enter fullscreen mode Exit fullscreen mode

Now update the Setting_data.json file with the following code:

"grid-box": {
        "type": "grid-box", 
        "settings": { 
            "image": "shopify:\/\/shop_images\/pexels-sam-lion-5710223.jpg" 
         } 
} 
Enter fullscreen mode Exit fullscreen mode

Now write your section name in content for an index of your home page section.

"content_for_index": [ 
      "grid-box" 
    ] 
Enter fullscreen mode Exit fullscreen mode

Top comments (0)