datetime-wrapper.html.twig in Open Social 8.9
Same filename and directory in other branches
- 8 themes/socialbase/templates/form/datetime-wrapper.html.twig
- 8.2 themes/socialbase/templates/form/datetime-wrapper.html.twig
- 8.3 themes/socialbase/templates/form/datetime-wrapper.html.twig
- 8.4 themes/socialbase/templates/form/datetime-wrapper.html.twig
- 8.5 themes/socialbase/templates/form/datetime-wrapper.html.twig
- 8.6 themes/socialbase/templates/form/datetime-wrapper.html.twig
- 8.7 themes/socialbase/templates/form/datetime-wrapper.html.twig
- 8.8 themes/socialbase/templates/form/datetime-wrapper.html.twig
Default theme implementation of a datetime form wrapper.
Available variables:
- content: The form element to be output, usually a datelist, or datetime.
- title: The title of the form element.
- title_attributes: HTML attributes for the title wrapper.
- description: Description text for the form element.
- required: An indicator for whether the associated form element is required.
See also
File
themes/socialbase/templates/form/datetime-wrapper.html.twigView source
- {#
- /**
- * @file
- * Default theme implementation of a datetime form wrapper.
- *
- * Available variables:
- * - content: The form element to be output, usually a datelist, or datetime.
- * - title: The title of the form element.
- * - title_attributes: HTML attributes for the title wrapper.
- * - description: Description text for the form element.
- * - required: An indicator for whether the associated form element is required.
- *
- * @ingroup templates
- *
- * @see template_preprocess_datetime_wrapper()
- */
- #}
- {%
- set title_classes = [
- 'control-label',
- required ? 'form-required',
- ]
- %}
-
- {%
- set classes = [
- errors ? 'error has-error',
- ]
- %}
-
- <div{{ attributes.addClass(classes) }}>
- {% if title %}
- <label{{ title_attributes.addClass(title_classes) }}>{{ title }}</label>
- {% if required %}
- <span class="form-required">*</span>
- {% endif %}
- {% endif %}
- {{ content }}
- {% if errors %}
- <div class="form-item--error-message alert alert-danger alert-sm alert-dismissible form-control-radius">
- <a href="#" role="button" class="close" data-dismiss="alert" aria-label="{{ 'Close'|t }}"><span aria-hidden="true">×</span></a>
- {{ errors }}
- </div>
- <br />
- {% endif %}
- {% if description %}
- <div class="help-block">{{ description }}</div>
- {% endif %}
- </div>