home-icon
Multi select
Last updated: Oct 23, 2024

Introduction

The purpose of the multi select element is to be able to present a predefined list of options to the user where they can select one or more options. This element is presented to the user as a dropdown list with options, when they select one, it will be visibly stacked to the already existing options.

Adding the multi select element

When you are adding a multi select element to a section for example, a part from the name and handle, you should specify the options. These are the options which will be presented to the user in the dropdown list. You can specify the list as a semicolon ( ; ) seperated list of options.

Display the options

To display the options in your frontend files you need to loop through the array of chosen values.

<?php foreach($multiSelectHandle as $option){
   echo $option;
} ?>

This will display all options chosen for the multi select element with the handle: multiSelectHandle.