details--plain.html.twig in Open Social 8
Same filename and directory in other branches
- 8.9 themes/socialbase/templates/system/details--plain.html.twig
- 8.2 themes/socialbase/templates/system/details--plain.html.twig
- 8.3 themes/socialbase/templates/system/details--plain.html.twig
- 8.4 themes/socialbase/templates/system/details--plain.html.twig
- 8.5 themes/socialbase/templates/system/details--plain.html.twig
- 8.6 themes/socialbase/templates/system/details--plain.html.twig
- 8.7 themes/socialbase/templates/system/details--plain.html.twig
- 8.8 themes/socialbase/templates/system/details--plain.html.twig
Theme override for a details element.
Available variables
- attributes: A list of HTML attributes for the details element.
- errors: (optional) Any errors for this details element, may not be set.
- title: (optional) The title of the element, may not be set.
- description: (optional) The description of the element, may not be set.
- children: (optional) The children of the element, may not be set.
- value: (optional) The value of the element, may not be set.
See also
File
themes/socialbase/templates/system/details--plain.html.twigView source
- {#
- /**
- * @file
- * Theme override for a details element.
- *
- * Available variables
- * - attributes: A list of HTML attributes for the details element.
- * - errors: (optional) Any errors for this details element, may not be set.
- * - title: (optional) The title of the element, may not be set.
- * - description: (optional) The description of the element, may not be set.
- * - children: (optional) The children of the element, may not be set.
- * - value: (optional) The value of the element, may not be set.
- *
- * @see template_preprocess_details()
- */
- #}
- {% set heading = title %}
- {% set body = children %}
-
- {%
- set classes = [
- 'panel',
- errors ? 'panel-danger' : 'panel-' ~ panel_type|clean_class,
- ]
- %}
- <div{{ attributes.addClass(classes).removeClass('form-wrapper') }}>
- {# Heading #}
-
- {% if heading %}
- {% block heading %}
- <div class="panel-heading">
- <header>
- {%
- set heading_classes = [
- 'panel-title',
- ]
- %}
- {% if collapsible %}
- <a{{ heading_attributes.addClass(heading_classes) }} href="{{ target }}">{{ heading }}</a>
- {% else %}
- <div{{ heading_attributes.addClass(heading_classes) }}>{{ heading }}</div>
- {% endif %}
- </header>
- </div>
- {% endblock %}
- {% endif %}
-
- {# Body #}
- {% block body %}
- {%
- set body_classes = [
- 'panel-body',
- collapsible ? 'panel-collapse',
- collapsible ? 'collapse',
- collapsible ? 'fade',
- errors or collapsible and not collapsed ? 'in',
- ]
- %}
- {%
- set description_classes = [
- 'help-block',
- description and description.position == 'invisible' ? 'sr-only',
- ]
- %}
-
- <div{{ body_attributes.addClass(body_classes) }}>
- {% if description and description.position == 'before' %}
- <p{{ description.attributes.addClass(description_classes) }}>{{ description.content }}</p>
- {% endif %}
- {{ body }}
- {% if description and description.position == 'after' or description.position == 'invisible' %}
- <p{{ description.attributes.addClass(description_classes) }}>{{ description.content }}</p>
- {% endif %}
- </div>
- {% endblock %}
-
- {# Footer #}
- {% if footer %}
- {% block footer %}
- {%
- set footer_classes = [
- 'panel-footer',
- ]
- %}
- <div{{ footer_attributes.addClass(footer_classes) }}>{{ footer }}</div>
- {% endblock %}
- {% endif %}
-
- </div>