Added section through code, not showing on 'Add Section' button. I just wanna quit...

brightnight1012
Excursionist
29 1 3

Recently, I added a file called 'background-video.liquid' to the sections folder in order to create a section titled 'Video Background.' However, I'm facing an issue where the section doesn't show up in the 'Add Section' dropdown list when navigating to the Customize menu on Shopify. I'm seeking assistance on resolving this matter. Any guidance would be greatly appreciated.

background-video.liquid code: https://pastebin.com/wM45zhBL

LINK: vanishpen.co

Replies 5 (5)

Abdosamer
Shopify Partner
821 146 163

Hi @brightnight1012 , In order to show "add section" , you should add the presets attribute to the section schema, this will make your section a dynamic section that you can add anywhere in your theme .

Example:

"presets": [
    {
      "name": "Announcement bar",
      "category": "Text"
    }
  ]
}
Buy me a Coffee
Email : abdelrahamansamer71@gmail.com
Chat on WhatsApp
Work samples
brightnight1012
Excursionist
29 1 3

Unfortunately, the 'presets' attribute is already included before the 'endschema' in the file. For a detailed view of the code, please refer to this link: https://pastebin.com/wM45zhBL

Abdosamer
Shopify Partner
821 146 163

@brightnight1012 , I tested your section on a couple of themes I have and it seems to work fine.

Buy me a Coffee
Email : abdelrahamansamer71@gmail.com
Chat on WhatsApp
Work samples
brightnight1012
Excursionist
29 1 3

In the Taste theme – when I click the 'Add Section' button in Customize, nothing happens. There is no "Video Background" appearing. I need to troubleshoot this. Any guidance on how to address and resolve this matter would be greatly appreciated.

EDIT: Now it somehow works... two hours after I implemented it and after about 5 times of logging in and out of the Shopify dashboard.

Abdosamer
Shopify Partner
821 146 163

@brightnight1012 , make sure to make 

"max_blocks": 2, instead of 1 so you can add an image to your section.
Buy me a Coffee
Email : abdelrahamansamer71@gmail.com
Chat on WhatsApp
Work samples