dropdown.html.twig in Open Social 8.4
Same filename in this branch
Same filename and directory in other branches
- 8.9 themes/socialbase/templates/form/dropdown.html.twig
- 8 themes/socialbase/templates/form/dropdown.html.twig
- 8.2 themes/socialbase/templates/form/dropdown.html.twig
- 8.3 themes/socialbase/templates/form/dropdown.html.twig
- 8.5 themes/socialbase/templates/form/dropdown.html.twig
- 8.6 themes/socialbase/templates/form/dropdown.html.twig
- 8.7 themes/socialbase/templates/form/dropdown.html.twig
- 8.8 themes/socialbase/templates/form/dropdown.html.twig
Theme override for a dropdown element.
Available variables:
- attributes: HTML attributes for the dropdown tag.
- options: The option element children.
See also
File
themes/socialbase/templates/form/dropdown.html.twigView source
- {#
- /**
- * @file
- * Theme override for a dropdown element.
- *
- * Available variables:
- * - attributes: HTML attributes for the dropdown tag.
- * - options: The option element children.
- *
- * @see template_preprocess_dropdown()
- */
- #}
- <div{{ attributes.addClass('dropdown field--name-field-post-visibility') }}>
- {# See PostForm.php we set edit_mode to true so people can't actually change the dropdown button for edit mode. #}
- <button id="post-visibility" type="button" {% if edit_mode %}disabled{% endif %} data-toggle="dropdown" aria-expanded="false" aria-haspopup="true" class="btn btn-default dropdown-toggle">
- <svg class="icon-small">
- <use id="btnicon" xlink:href="#icon-{{ selected_icon }}"></use>
- </svg>
- <span class="text">{{ selected }} </span>
- {% if not edit_mode %}<span class="caret"></span>{% endif %}
- </button>
- {% if not edit_mode %}
- <ul role="menu" aria-labelledby="post-visibility" class="dropdown-menu dropdown-menu--visibility">
- <li class="dropdown-header">{{ label }}</li>
- {% for key, child in items %}
- <li class="list-item list-item--visibility {% if key == active %}list-item--active{% endif %}"> {{ child }}
- </li>
- {% endfor %}
- </ul>
- {% endif %}
- </div>