field--field-paragraphs-demo.html.twig

Theme override for a field_paragraph_demo entity reference field.

We want to remove as much div wrappers as possible so generated HTML structure is minimal as possible.

Available variables:

  • attributes: HTML attributes for the containing element.
  • label_hidden: Whether to show the field label or not.
  • title_attributes: HTML attributes for the title.
  • label: The label for the field.
  • multiple: TRUE if a field can contain multiple items.
  • items: List of all the field items. Each item contains:
    • attributes: List of HTML attributes for each item.
    • content: The field item's 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.

See also

template_preprocess_field()

File

paragraphs_collection/modules/paragraphs_collection_demo/templates/field--field-paragraphs-demo.html.twig
View source
  1. {% extends "@paragraphs_collection/field--paragraphs.html.twig" %}
  2. {#
  3. /**
  4. * @file
  5. * Theme override for a field_paragraph_demo entity reference field.
  6. *
  7. * We want to remove as much div wrappers as possible so generated HTML
  8. * structure is minimal as possible.
  9. *
  10. * Available variables:
  11. * - attributes: HTML attributes for the containing element.
  12. * - label_hidden: Whether to show the field label or not.
  13. * - title_attributes: HTML attributes for the title.
  14. * - label: The label for the field.
  15. * - multiple: TRUE if a field can contain multiple items.
  16. * - items: List of all the field items. Each item contains:
  17. * - attributes: List of HTML attributes for each item.
  18. * - content: The field item's content.
  19. * - entity_type: The entity type to which the field belongs.
  20. * - field_name: The name of the field.
  21. * - field_type: The type of the field.
  22. * - label_display: The display settings for the label.
  23. *
  24. *
  25. * @see template_preprocess_field()
  26. */
  27. #}
  28. {% block content %}
  29. <div{{ attributes }}>
  30. {% for item in items %}
  31. {{ item.content }}
  32. {% endfor %}
  33. </div>
  34. {% endblock %}