FF Checkbox Group
FF Checkbox Group gives you a group of checkboxes within a single field or FF Matrix cell.
Configuration
FF Checkbox Group has one setting, “Checkbox Options”, a single textarea in which you specify each checkbox option you want as part of the group.
List one option per line:
Herbie Hancock
Bob Dylan
The Bad Plus
You can optionally specify input values for each option:
herbie : Herbie Hancock
bobby : Bob Dylan
tbp : The Bad Plus
Templates
Tag Parameters
The following parameters can be added to FF Checkbox Group’s primary tag pair, :all_options, :ol, and :ul tags:
sort="asc|desc"- Sort the options in ascending or descending order
backspace- Strip the last X characters from the tag output
Primary Tag Pair
Calling your FF Checkbox Group field with a tag pair allows you to fully customize the output:
<p>I like {favorite_things backspace="2"}{option}, {/favorite_things}.</p>
Single Variable Tags
The following single variables are available within your tag pair:
{count}- The current option’s index
{option}- The current option
{option_name}- If you specified a name for your option, this is how you access it. Otherwise, it will return the same thing as
{option}. switch- Switch between multiple values based on the current option index
:all_options Tag Pair
If you want to loop through each of your options, regardless of whether or not they’re selected, use this tag.
All things: {favorite_things:all_options backspace="2"}{option}, {/favorite_things:all_options}
Single Variable Tags
The :all_options tag pair supports each of the primary tag pair’s single variable tags, plus one more:
{selected}- For use in conditionals; returns whether or not the current option is selected
{favorite_things:all_options} <p>I {if {selected} == ""}don’t{/if} like {option}.</p> {/favorite_things:all_options}
:ol and :ul Tags
Returns an ordered/unordered list of each of your selected options
<h3>My favorite things:</h3>
{favorite_things:ul sort="asc"}
:selected Tag
For use in conditionals; returns whether or not a particular option is selected.
{if {favorite_things:selected option="kittens"}}
<p>Kittens!!!</p>
{/if}