Hello
I am using variables in my static page layout.
Is it possible to make these variables invisible in the CMS pages, unless the switch is set to true?
Right now, even if the switch is false, the client can still see the fields related to the switch, but the data will only show in the frontend if the switch is true.
Example: I have the following set of variables declared in my layout:
<!-- HERO IMAGE -->
{variable name="hero_enabled" label="Display?" type="switch" tab="Hero"}{/variable}
{variable name="hero_image" label="Hero image" type="mediafinder" mode="image" tab="Hero"}{/variable}
{variable name="hero_image_alt" label="Description of the image for SEO" type="text" tab="Hero"}{/variable}
So, what I would like to do is that if
hero_enabled (type switch) == false,
do not show hero_image & hero_image_alt in the backend pages tab.
Hiding the unnecessary fields in the backend would prevent a lot of confusing from the client. Is this possible with OctoberCMS? I have been googling for a long time but i can't find the answer.
Thank you for your time.
Last updated