Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
Hi,

I was wondering if there was a way to create a radio button in the admin panel, in a template, that allows you to enable or disable an element or text in the html. was thinking if the radio was somehow linked to the comment out markup, it could add or remove the comment eg. <!-- text or code enable disable -->

Thank you
Hi,

Not sure if I could understand the use-case perfectly but if you wish to conditionally hide/show certain markup on the frontend here is one way of doing it -

Define a checkbox like this -
Code: Select all
<cms:editable name="show_something" label="Show this element?" opt_values='Yes=1' type='checkbox' />

Then on the frontend, vary your markup depending on the value of the checkbox e.g.
Code: Select all
<cms:if show_something>
    .. this will be outputted only if the checkbox above is set ..
</cms:if>

Hope it helps.
Hi KK,

Thanks for the help will try it out. It is so i can keep the same template for more then one scenario instead of having to create a whole new one just because one element/ extra menu/ text/ field is required on that output of the template.

thanks all glories for you and your teams work!
Worked perfectly! Thank you KK. Not sure if this is the best way of going about adding extra elements they may or may not be required in a template. but seems to look and work fine. Please advise if there is some better way.
4 posts Page 1 of 1