Field Tags

The following tags are available for your Multiselect fields within {exp:channel:entries} and Matrix tag pairs.

Primary Tag Pair

Calling your Multiselect field with a tag pair allows you to fully customize the output:

<p>
    I like
    {my_multiselect_field backspace="2"}{option}, {/my_multiselect_field}.
</p>

Tag Parameters

The primary tag pair supports the following parameters:

sort
Sorts the selected options alphabetically. Can be set to either “asc” or “desc”.
backspace
Strips the last X characters from the tag output.

Variable Tags

The following variable tags are available within the primary tag pair:

{count}
The current option’s index.
{option}
The current option’s value.
{option_name}
If you specified a label 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.

:ol and :ul Tags

Returns an ordered/unordered list of each of your selected options.

<h3>My favorite things:</h3>
{my_multiselect_field:ul sort="asc"}

Tag Parameters

The :ol and :ul tags support the following parameters:

sort
Sorts the selected options alphabetically. Can be set to either “asc” or “desc”.

:selected Tag

For use in conditionals; returns whether or not a particular option is selected.

{if '{my_multiselect_field:selected option="kittens"}'}
  <p>Kittens!!!</p>
{/if}

:total_selections Tag

Returns the total number of selected options.

I have {my_multiselect_field:total_selections} favorites.