You are here

eck-content-add-list.html.twig in Entity Construction Kit (ECK) 8

Default theme implementation to list entity types available for adding content.

Available variables:

  • types: A list of a specific entity type bundles , each with the following properties:

    • type: The entity bundle label.
    • add_link: Link to create a piece of content of this type.
    • description: Description of this type of content.
  • entity_type: The entity type
    • id: The entity type id
    • label: The entity type label

File

templates/eck-content-add-list.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to list entity types available for adding content.
  5. *
  6. * Available variables:
  7. * - types: A list of a specific entity type bundles , each with the following
  8. * properties:
  9. * - type: The entity bundle label.
  10. * - add_link: Link to create a piece of content of this type.
  11. * - description: Description of this type of content.
  12. * - entity_type: The entity type
  13. * - id: The entity type id
  14. * - label: The entity type label
  15. *
  16. * @see template_preprocess_eck_content_add_list()
  17. *
  18. * @ingroup themeable
  19. */
  20. #}
  21. {% if types is not empty %}
  22. <ul class="admin-list">
  23. {% for type in types %}
  24. <li class="clearfix">
  25. <a href="{{ type.add_link }}">
  26. <span class="label">
  27. {{ type.type }}
  28. </span>
  29. <div class="description">
  30. {{ type.description }}
  31. </div>
  32. </a>
  33. </li>
  34. {% endfor %}
  35. </ul>
  36. {% else %}
  37. <p>
  38. {% set create_bundle = path('eck.entity.' ~ entity_type.id ~ '_type.add') %}
  39. {% trans %}
  40. You have not created any bundles for this type yet. Go to the <a
  41. href="{{ create_bundle }}"> bundle creation page</a> to add a
  42. new bundle.
  43. {% endtrans %}
  44. </p>
  45. {% endif %}