Using Checkbox to Activate the Display of Content
I have a Checkbox variable type that I want to use to toggle content to display or not, but can't figure out the way to do it. I've been trying to read between the lines on the docs and haven't been successful. This is how I have it currently:
{exp:low_variables:options var="lv_content_alert_on"}
{if checked == "checked"}
<div class="alert alert-info">
<button class="close" data-dismiss="alert">×</button>
<strong>Alert!</strong> {exp:low_variables:single var="lv_content_alert_text"}
</div>
{/if}
{/exp:low_variables:options}
Replies
Low 25 Jun 2012 08:28
The checkbox variable is saved as 'y' when checked, or an empty string if unchecked. This means you can use the regular variable syntax, for example:
Tinch 25 Jun 2012 15:26
Hmm, that doesn't seem to be working. This is how I have it now:
Low 25 Jun 2012 20:44
Is Early Parsing enabled for that variable?
Tinch 25 Jun 2012 21:22
That did the trick. Thanks so much Low!