{{ select }}

Represents the selection from a select list. The select list may or may not allow multiple selections (defaults to only allow a single selection).

Properties

string object_type
Will always be "select".
true/false is_valid
True if one of the defined options is selected. To make a (none) option, define an option with an empty value.
string value
Delimited string containing the values from all of the selected options. For select fields you do not typically care about this - use selected or values instead.
string output
String containing the text from all of the selected options.
html output_in_list
Same as output.
string field_id
The identifier for this field.
string default_value
The default value for this field if no value is specified.
object options
Contains all of the available options for this select list. Each option is a property on the object where they property key is the option value and the property value is the option text.
list selected
A list containing the values from all of the selected options.
list values
A list containing the text from all of the selected options.
number count
The number of selected options.

Examples

{% if page.page_layout.is_valid %}
	<div class="sidebar-{{ page.page_layout.value }}">
		{% let includeTemplate = "Sidebar-" | append:page.page_layout.value %}
		{% include includeTempalte %}
	</div>
{% endif %}

With Multiple Options

{% if page.sidebar_sections.count > 0 %}
	{% for section in page.sidebar_sections.selected %}
		{% include section %}
	{% endfor %}
{% endif %}

Developer Overview

Liquid Markup