recipe-yield.html.twig in Recipe 8.2
Theme for the recipe total time pseudo-field.
Available variables:
- attributes: HTML attributes for the containing element.
- label: The label for the field.
- label_hidden: Whether to show the field label or not.
- label_display: The display settings for the label.
- title_attributes: HTML attributes for the title.
- yield: The content to be displayed by the pseudo-field.
- content_attributes: HTML attributes for the content.
See also
1 theme call to recipe-yield.html.twig
File
templates/recipe-yield.html.twigView source
- {#
- /**
- * @file
- * Theme for the recipe total time pseudo-field.
- *
- * Available variables:
- * - attributes: HTML attributes for the containing element.
- * - label: The label for the field.
- * - label_hidden: Whether to show the field label or not.
- * - label_display: The display settings for the label.
- * - title_attributes: HTML attributes for the title.
- * - yield: The content to be displayed by the pseudo-field.
- * - content_attributes: HTML attributes for the content.
- *
- * @see template_preprocess_recipe_total_time()
- */
- #}
- {%
- set classes = [
- 'field',
- 'field--name-recipe-yield',
- 'field--type-integer',
- 'field--label-' ~ label_display,
- ]
- %}
- {%
- set title_classes = [
- 'field__label',
- label_display == 'visually_hidden' ? 'visually-hidden',
- ]
- %}
-
- {% if label_hidden %}
- <div{{ content_attributes.addClass(classes, 'field__item') }}>{{ yield }}</div>
- {% else %}
- <div{{ attributes.addClass(classes) }}>
- <div{{ title_attributes.addClass(title_classes) }}>{{ label }}</div>
- <div{{ content_attributes.addClass('field__item') }}>{{ yield }}</div>
- </div>
- {% endif %}