Greetings.
I was wondering how it will be possible to integrate a <cms:if> statement with an editable region with multiple potential values?
For example, say in my <cms:template> i have
What sort of if statement would I use to determine which checkboxes are selected? I want to display a particular block of code depending on which checkbox or boxes are selected. Here's a sort of idea of what I want here (code not functional):
This works fine if the user only selects one option, but I need to also handle if the user selects multiple options, unfortunately it just returns separated values.
How can I get this to work?
TIA!
I was wondering how it will be possible to integrate a <cms:if> statement with an editable region with multiple potential values?
For example, say in my <cms:template> i have
- Code: Select all
<cms:editable name='options' label='Options' desc='Select some options' type='checkbox' opt_values='apple | banana | orange | pear | grape'></cms:editable>
What sort of if statement would I use to determine which checkboxes are selected? I want to display a particular block of code depending on which checkbox or boxes are selected. Here's a sort of idea of what I want here (code not functional):
- Code: Select all
<cms:if options='apple'>
<p>You picked an apple</p>
</cms:if>
<cms:if options='banana'>
<p>You picked a banana </p>
</cms:if>
<cms:if options='orange'>
<p>You picked an orange </p>
</cms:if>
<cms:if options='pear'>
<p>You picked a pear </p>
</cms:if>
<cms:if options='grape'>
<p>You picked a grape</p>
</cms:if>
This works fine if the user only selects one option, but I need to also handle if the user selects multiple options, unfortunately it just returns separated values.
How can I get this to work?
TIA!