How can one implement true/false logic in schema checkboxes?

I am really hoping someone can answer this question for me. I created a checkbox in my sections schema, but I can’t find any information on how to add “true” or “false” logic using this checkbox, which is purely cosmetic right now.

  1. What is the suggested language or method to listening for these true/false checkboxes?

  2. Is there any way in liquid to set this using a snippet?

Really, the overarching question is, "how the heck do you use these checkboxes to do something with the interface?

Thanks!

Here’s the schema checkbox code:

Here’s the interface and panel where the checkbox displays.

You can use it like this on your section file:

{%- if section.settings.fliprows -%}
 Code that will execute if the checkbox is ticked in the theme customizer
{%- endif -%}

Hello Goldendust20,

Kindly welcome to the Shopify Community.
I properly read your problem, and I dearly need to carefully analyze your website to provide a solution here.
Would you kindly share your website URL and if your website is password protected then also provide a password?

I will carefully check out the issue and provide a solution to you here.

Please let me know if you have any further questions.

GENIUS! Exactly what I was looking for. Thank you kindly, I’m going to triple bookmark this xD

1 Like

Awesome! Glad I could help :blush:

{%- if section.settings.showconten -%}

hello header

{%- endif -%}

not working for me

“type”: “checkbox”,
“id”: “showconten”,
“label”: “Show content”,
“default”: false

Could you post your CSS and the rest of your schema? I want to verify if you’re using a block or a section. Thanks!

You’ll want to make sure if you’re using a block or section, that’s reflected in your code.

{%- if section.settings.showconten -%}

should be

{%- if block.settings.showconten -%}

Give that a try :slightly_smiling_face:

I’m using a section not a block, I have tried both didn’t work

What is your CSS or jQuery logic? When you say it isn’t working, what are you trying to have the checkbox do?

when you are in the store admin → customise → section …
have you SAVE after checking/uncheking…?