You are here

entity-add-list.html.twig in Drupal 10

Theme override to present a list of available bundles.

Available variables:

  • bundles: A list of bundles, each with the following properties:

    • label: Bundle label.
    • description: Bundle description.
    • add_link: Link to create an entity of this bundle.
  • add_bundle_message: The message shown when there are no bundles. Only available if the entity type uses bundle entities.

File

core/themes/stable9/templates/content-edit/entity-add-list.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override to present a list of available bundles.
  5. *
  6. * Available variables:
  7. * - bundles: A list of bundles, each with the following properties:
  8. * - label: Bundle label.
  9. * - description: Bundle description.
  10. * - add_link: Link to create an entity of this bundle.
  11. * - add_bundle_message: The message shown when there are no bundles. Only
  12. * available if the entity type uses bundle entities.
  13. *
  14. * @see template_preprocess_entity_add_list()
  15. */
  16. #}
  17. {% if bundles is not empty %}
  18. <dl>
  19. {% for bundle in bundles %}
  20. <dt>{{ bundle.add_link }}</dt>
  21. <dd>{{ bundle.description }}</dd>
  22. {% endfor %}
  23. </dl>
  24. {% elseif add_bundle_message is not empty %}
  25. <p>
  26. {{ add_bundle_message }}
  27. </p>
  28. {% endif %}