You are here

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

Theme override to list node types available for adding content.

This list is displayed on the Add content admin page.

Available variables:

  • types: A list of content types, each with the following properties:

    • add_link: Link to create a piece of content of this type.
    • description: Description of this type of content.

File

core/themes/bartik/templates/classy/content-edit/node-add-list.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override to list node types available for adding content.
  5. *
  6. * This list is displayed on the Add content admin page.
  7. *
  8. * Available variables:
  9. * - types: A list of content types, each with the following properties:
  10. * - add_link: Link to create a piece of content of this type.
  11. * - description: Description of this type of content.
  12. *
  13. * @see template_preprocess_node_add_list()
  14. */
  15. #}
  16. {% if types is not empty %}
  17. <dl class="node-type-list">
  18. {% for type in types %}
  19. <dt>{{ type.add_link }}</dt>
  20. <dd>{{ type.description }}</dd>
  21. {% endfor %}
  22. </dl>
  23. {% else %}
  24. <p>
  25. {% set create_content = path('node.type_add') %}
  26. {% trans %}
  27. You have not created any content types yet. Go to the <a href="{{ create_content }}">content type creation page</a> to add a new content type.
  28. {% endtrans %}
  29. </p>
  30. {% endif %}