Skip to content
Snippets Groups Projects
Unverified Commit 78a9cd74 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3476649 by stefan.korn, supriyak: starterkit theme should use same...

Issue #3476649 by stefan.korn, supriyak: starterkit theme should use same fieldset template than stable9
parent e65e7886
Branches 8.x-1.x
Tags 2.0.0-beta1 8.x-1.0-beta1
No related merge requests found
...@@ -4,18 +4,24 @@ ...@@ -4,18 +4,24 @@
* Theme override for a fieldset element and its children. * Theme override for a fieldset element and its children.
* *
* Available variables: * Available variables:
* - attributes: HTML attributes for the fieldset element. * - attributes: HTML attributes for the <fieldset> element.
* - errors: (optional) Any errors for this fieldset element, may not be set. * - errors: (optional) Any errors for this <fieldset> element, may not be set.
* - required: Boolean indicating whether the fieldset element is required. * - required: Boolean indicating whether the <fieldset> element is required.
* - legend: The legend element containing the following properties: * - legend: The <legend> element containing the following properties:
* - title: Title of the fieldset, intended for use as the text of the legend. * - title: Title of the <fieldset>, intended for use as the text
* - attributes: HTML attributes to apply to the legend. of the <legend>.
* - attributes: HTML attributes to apply to the <legend> element.
* - description: The description element containing the following properties: * - description: The description element containing the following properties:
* - content: The description content of the fieldset. * - content: The description content of the <fieldset>.
* - attributes: HTML attributes to apply to the description container. * - attributes: HTML attributes to apply to the description container.
* - children: The rendered child elements of the fieldset. * - description_display: Description display setting. It can have these values:
* - prefix: The content to add before the fieldset children. * - before: The description is output before the element.
* - suffix: The content to add after the fieldset children. * - after: The description is output after the element (default).
* - invisible: The description is output after the element, hidden visually
* but available to screen readers.
* - children: The rendered child elements of the <fieldset>.
* - prefix: The content to add before the <fieldset> children.
* - suffix: The content to add after the <fieldset> children.
* *
* @see template_preprocess_fieldset() * @see template_preprocess_fieldset()
*/ */
...@@ -41,6 +47,9 @@ ...@@ -41,6 +47,9 @@
<span{{ legend_span.attributes.addClass(legend_span_classes) }}>{{ legend.title }}</span> <span{{ legend_span.attributes.addClass(legend_span_classes) }}>{{ legend.title }}</span>
</legend> </legend>
<div class="fieldset-wrapper"> <div class="fieldset-wrapper">
{% if description_display == 'before' and description.content %}
<div{{ description.attributes.addClass('description') }}>{{ description.content }}</div>
{% endif %}
{% if errors %} {% if errors %}
<div class="form-item--error-message"> <div class="form-item--error-message">
<strong>{{ errors }}</strong> <strong>{{ errors }}</strong>
...@@ -53,7 +62,7 @@ ...@@ -53,7 +62,7 @@
{% if suffix %} {% if suffix %}
<span class="field-suffix">{{ suffix }}</span> <span class="field-suffix">{{ suffix }}</span>
{% endif %} {% endif %}
{% if description.content %} {% if description_display in ['after', 'invisible'] and description.content %}
<div{{ description.attributes.addClass('description') }}>{{ description.content }}</div> <div{{ description.attributes.addClass('description') }}>{{ description.content }}</div>
{% endif %} {% endif %}
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment