Skip to content

Checkbox group

Several boxes at once: any number of them may be ticked.

Settings:

SettingWhat it does
OptionsA static list, or read from a model — as in Select
ColumnsHow many boxes fit across, 3 by default
DefaultWhat is ticked in a new record

The value holds every ticked option, so the template iterates:

html
<ul class="tags">
    {foreach $features as $feature}
        <li>{$feature}</li>
    {/foreach}
</ul>

To test for one option, use in:

html
{if 'delivery' in $features}
    <p>We deliver</p>
{/if}

Same job as a multiple Select, different shape

A checkbox group shows every option at once; a multi-select Select hides them behind a click. Short list — boxes; long list — dropdown.

© PageBlocks 2019-present