entity-add-list.html.twig

Same filename in this branch
  1. 9 core/themes/stable9/templates/content-edit/entity-add-list.html.twig
  2. 9 core/themes/claro/templates/entity-add-list.html.twig
  3. 9 core/themes/stable/templates/content-edit/entity-add-list.html.twig
  4. 9 core/modules/system/templates/entity-add-list.html.twig
Same filename in other branches
  1. 8.9.x core/themes/seven/templates/entity-add-list.html.twig
  2. 8.9.x core/themes/claro/templates/entity-add-list.html.twig
  3. 8.9.x core/themes/stable/templates/content-edit/entity-add-list.html.twig
  4. 8.9.x core/modules/system/templates/entity-add-list.html.twig
  5. 10 core/themes/stable9/templates/content-edit/entity-add-list.html.twig
  6. 10 core/themes/claro/templates/entity-add-list.html.twig
  7. 10 core/modules/system/templates/entity-add-list.html.twig
  8. 11.x core/themes/stable9/templates/content-edit/entity-add-list.html.twig
  9. 11.x core/themes/claro/templates/entity-add-list.html.twig
  10. 11.x core/modules/system/templates/entity-add-list.html.twig

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.

See also

template_preprocess_entity_add_list()

1 theme call to entity-add-list.html.twig
EntityController::addPage in core/lib/Drupal/Core/Entity/Controller/EntityController.php
Displays add links for the available bundles.

File

core/themes/seven/templates/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. <ul class="admin-list">
  19. {% for bundle in bundles %}
  20. <li class="clearfix"><a href="{{ bundle.add_link.url }}"><span class="label">{{ bundle.label }}</span><div class="description">{{ bundle.description }}</div></a></li>
  21. {% endfor %}
  22. </ul>
  23. {% elseif add_bundle_message is not empty %}
  24. <p>
  25. {{ add_bundle_message }}
  26. </p>
  27. {% endif %}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.