form.html.twig in Open Social 8.8
Same filename and directory in other branches
- 8.9 themes/socialbase/templates/form/form.html.twig
- 8 themes/socialbase/templates/form/form.html.twig
- 8.2 themes/socialbase/templates/form/form.html.twig
- 8.3 themes/socialbase/templates/form/form.html.twig
- 8.4 themes/socialbase/templates/form/form.html.twig
- 8.5 themes/socialbase/templates/form/form.html.twig
- 8.6 themes/socialbase/templates/form/form.html.twig
- 8.7 themes/socialbase/templates/form/form.html.twig
Default theme implementation for a 'form' element.
Available variables
- attributes: A list of HTML attributes for the wrapper element.
- children: The child elements of the form.
See also
File
themes/socialbase/templates/form/form.html.twigView source
- {#
- /**
- * @file
- * Default theme implementation for a 'form' element.
- *
- * Available variables
- * - attributes: A list of HTML attributes for the wrapper element.
- * - children: The child elements of the form.
- *
- * @see template_preprocess_form()
- *
- * @ingroup themeable
- */
- #}
-
- {% if attributes.hasClass('form--default') %}
- {{ attach_library('socialbase/form-default') }}
- {% endif %}
-
- {% if attributes.hasClass('card') %}
- <form{{ attributes.removeClass('card') }}>
- <div class="card">
- <div class="card__block">
- {{ children }}
- </form>
-
- {#
- The card is closed function socialbase_form_alter in the info_text suffix
- #}
-
- {% elseif is_search_form %}
-
- {% if in_hero_region %}
-
- <form{{ attributes }}>
- <div class="form-group">
- {{ children }}
- </div>
- </form>
-
- {% elseif in_content_top_region %}
-
- <form{{ attributes.addClass('search-take-over') }}>
- <div class="form-group">
- <button class="btn--close-search-take-over" type="button">
- <svg class="icon-search-form-close">
- <title>{% trans %}Close{% endtrans %}</title>
- <use xlink:href="#icon-close"></use>
- </svg>
- </button>
- {{ children }}
- </div>
- </form>
-
- {% else %}
-
- <form{{ attributes }}>
- <div class="form-group form--navbar-search" id="navbar-search">
- {{ children }}
- </div>
- </form>
-
- {% endif %}
-
- {% else %}
-
- <form{{ attributes }}>
- {{ children }}
- </form>
-
- {% endif %}