You are here

entity-extra-field.html.twig in Entity Extra Field 2.0.x

Same filename and directory in other branches
  1. 8 templates/entity-extra-field.html.twig

Default theme implementation to entity extra field.

Available variables:

  • content: The content of the extra field.
  • attributes: array of HTML attributes populated by modules, intended to be added to the main container tag of this template.

    • id: A valid HTML ID and guaranteed unique.
  • content_attributes: Same as attributes, except applied to the main content tag that appears in the template.

File

templates/entity-extra-field.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to entity extra field.
  5. *
  6. * Available variables:
  7. * - content: The content of the extra field.
  8. * - attributes: array of HTML attributes populated by modules, intended to
  9. * be added to the main container tag of this template.
  10. * - id: A valid HTML ID and guaranteed unique.
  11. * - content_attributes: Same as attributes, except applied to the main content
  12. * tag that appears in the template.
  13. *
  14. * @see template_preprocess_entity_extra_field()
  15. *
  16. * @ingroup themeable
  17. */
  18. #}
  19. <div{{ attributes }}>
  20. {% set label = label|render %}
  21. {% if label %}
  22. <h2{{ title_attributes }}>
  23. {{ label }}
  24. </h2>
  25. {% endif %}
  26. <div{{ content_attributes }}>
  27. {{ content }}
  28. </div>
  29. </div>