is it possible to hide or show sections or blocks via code? I wand to add a timer functionality, so some blocks will be made visible and hidden at a certain date and time. In the JSON file there is a option or “disabled” when you manually hide a secion/block in theme editor. But is it also possible to do this via code?
A workaround would be to just hide the block with CSS or remove the HTML content via JS. But it would be great, if also the “eye” would be updated, so the icon shows the correct state.
I don’t have asked for a code. It was simple question. I know how to add a checkbox and remove HTML output via CSS or JS, I also know how to add fields for set a timer. But My question was if it is possible to change the status the view-indicator (eye symbol). You don’t gave me an answer to this.
You can’t access the JSON disabled attribute but you can add the checkbox and put validation of its state like if checkbox state is checked and write the whole code inside the statement.
By this code will not show when checkbox is not checked
I think my first question was not totally clear. I also have mentioned workarounds etc. sorry that was my fault. Of course I know how to hide code blocks in liquid with conditional statements. The idea with JS was stupid. And I only wanted to know about the json disabled feature anyway, many thanks for your help!!