You are here

entity-add-list.html.twig in Entity API 8.0

Default theme implementation to present a list of available bundles.

Available variables:

  • create_bundle_url: The url to the bundle creation page.
  • bundle_type_label: The lowercase label of the bundle entity type.
  • bundles: A list of bundles, each with the following properties:
    • add_link: link to create an entity of this bundle.
    • description: Bundle description.

File

templates/entity-add-list.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to present a list of available bundles.
  5. *
  6. * Available variables:
  7. * - create_bundle_url: The url to the bundle creation page.
  8. * - bundle_type_label: The lowercase label of the bundle entity type.
  9. * - bundles: A list of bundles, each with the following properties:
  10. * - add_link: link to create an entity of this bundle.
  11. * - description: Bundle description.
  12. *
  13. * @see template_preprocess_entity_add_list()
  14. *
  15. * @ingroup themeable
  16. */
  17. #}
  18. {% if bundles is not empty %}
  19. <dl>
  20. {% for bundle in bundles %}
  21. <dt>{{ bundle.add_link }}</dt>
  22. <dd>{{ bundle.description }}</dd>
  23. {% endfor %}
  24. </dl>
  25. {% else %}
  26. <p>
  27. {% trans %}
  28. Go to the <a href="{{ create_bundle_url }}">{{ bundle_type_label }} creation page</a> to add a new {{ bundle_type_label }}.
  29. {% endtrans %}
  30. </p>
  31. {% endif %}