Same filename in this branch
  1. 10 core/modules/node/templates/field--node--title.html.twig
  2. 10 core/themes/stable9/templates/field/field--node--title.html.twig
  3. 10 core/themes/starterkit_theme/templates/field/field--node--title.html.twig
  4. 10 core/themes/claro/templates/classy/field/field--node--title.html.twig
  5. 10 core/profiles/demo_umami/themes/umami/templates/classy/field/field--node--title.html.twig
Same filename and directory in other branches
  1. 8.9.x core/modules/node/templates/field--node--title.html.twig
  2. 9 core/modules/node/templates/field--node--title.html.twig

Default theme implementation for the node title field.

This is an override of field.html.twig for the node title field. See that template for documentation about its details and overrides.

Available variables:

  • attributes: HTML attributes for the containing span element.
  • items: List of all the field items. Each item contains:
    • attributes: List of HTML attributes for each item.
    • content: The field item content.
  • entity_type: The entity type to which the field belongs.
  • field_name: The name of the field.
  • field_type: The type of the field.
  • label_display: The display settings for the label.
  • is_inline: If false, display an ordinary field. If true, display an inline format, suitable for inside elements such as <span>, <h2> and so on.

@todo Delete as part of https://www.drupal.org/node/3015623

See also

field.html.twig

node_preprocess_field__node()

File

core/modules/node/templates/field--node--title.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for the node title field.
  5. *
  6. * This is an override of field.html.twig for the node title field. See that
  7. * template for documentation about its details and overrides.
  8. *
  9. * Available variables:
  10. * - attributes: HTML attributes for the containing span element.
  11. * - items: List of all the field items. Each item contains:
  12. * - attributes: List of HTML attributes for each item.
  13. * - content: The field item content.
  14. * - entity_type: The entity type to which the field belongs.
  15. * - field_name: The name of the field.
  16. * - field_type: The type of the field.
  17. * - label_display: The display settings for the label.
  18. * - is_inline: If false, display an ordinary field.
  19. * If true, display an inline format, suitable for inside elements such as
  20. * <span>, <h2> and so on.
  21. *
  22. * @see field.html.twig
  23. * @see node_preprocess_field__node()
  24. *
  25. * @ingroup themeable
  26. *
  27. * @todo Delete as part of https://www.drupal.org/node/3015623
  28. */
  29. #}
  30. {% if not is_inline %}
  31. {% include "field.html.twig" %}
  32. {% else %}
  33. <span{{ attributes }}>
  34. {%- for item in items -%}
  35. {{ item.content }}
  36. {%- endfor -%}
  37. </span>
  38. {% endif %}

Related topics