You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
845 B
27 lines
845 B
{# |
|
/** |
|
* @file |
|
* Theme override for a select element. |
|
* |
|
* Available variables: |
|
* - attributes: HTML attributes for the <select> tag. |
|
* - options: The <option> element children. |
|
* |
|
* @see template_preprocess_select() |
|
*/ |
|
#} |
|
{% apply spaceless %} |
|
<select{{ attributes }}> |
|
{% for option in options %} |
|
{% if option.type == 'optgroup' %} |
|
<optgroup label="{{ option.label }}"> |
|
{% for sub_option in option.options %} |
|
<option value="{{ sub_option.value }}"{{ sub_option.selected ? ' selected="selected"' }}>{{ sub_option.label }}</option> |
|
{% endfor %} |
|
</optgroup> |
|
{% elseif option.type == 'option' %} |
|
<option value="{{ option.value }}"{{ option.selected ? ' selected="selected"' }}>{{ option.label }}</option> |
|
{% endif %} |
|
{% endfor %} |
|
</select> |
|
{% endapply %}
|
|
|