Customize theme Schema hide and unhide

alice_bambino
New Member
3 0 0

Hello,

 

On the homepage customize section you are able to create content which you can hide and un-hide like below in red.

 


c30baf53-5bb4-4df8-8147-39092f8160e6.png

I've created a new page called promo with similar sections and I would like for example to hide and un-hide the section called Ometria Form once the promotion as ended.

 

hide.png

 

Is it possible to add the ability to hide content? Possibly some code in the liquid Schema file?

Replies 3 (3)
BriskDevelopers
Shopify Expert
116 11 20

Hi @alice_bambino ,

Yes, it's possible!

You need to add a new section schema code like add one checkbox and add a condition in liquid code.

section schema code :

,{
    'type':'checkbox',
    'id':'enable_checkbox',
    'lablel':'Enable section'
}


for ex;

{% if section.settings.enable_checkbox %}
add your middle content code here...
{% endif %}


Regards,
Jay

If helpful then please Like and Accept Solution. Want to modify or custom changes on store Hire me. Feel free to contact us regarding any help, below our contact listed:
Shopify Expert Page: https://experts.shopify.com/brisk-developers
Email: support@briskdevelopers.com
Contact us: https://www.briskdevelopers.com/contact-us
Skype: briskdevelopers
BolsasBags
Tourist
7 0 1

Awesome! 


The part where is says "add middle code" ... Any directions on how to do this? Greetz! 

DolMart
New Member
1 0 0

I did try this... maybe I did it wrong. Well, not maybe... I'm sure cuz the result was not the one expected. I did have a different result.

I did this:

for example "image with text overlay" is the hero indication in the section area. 

so I look for the hero.example.liquid... and at the end of it I add:

,{

'type':'checkbox',
'id':'enable_checkbox',
'lablel':'Enable section'
}

Then at the ALTERNATIVE page created... inside, on the section after the{{ page.content }} I search for the listed section and put this one in-between the if condition as follows:

{% if section.settings.enable_checkbox %}
{% section 'hero-Example' %}
{% endif %}

  and saved!

but then, what happened was...  that someone works... cuz the section at the public page was not there.... but was not let me put it in public either. Not, if I don't take it out from inside the condition. 

I guess I doing everything wrong... or just something??? what is it?