Same filename in this branch
  1. 10 core/modules/node/templates/node-add-list.html.twig
  2. 10 core/themes/claro/templates/node-add-list.html.twig
  3. 10 core/themes/stable9/templates/content-edit/node-add-list.html.twig
  4. 10 core/themes/starterkit_theme/templates/content-edit/node-add-list.html.twig
  5. 10 core/profiles/demo_umami/themes/umami/templates/classy/content-edit/node-add-list.html.twig
Same filename and directory in other branches
  1. 8.9.x core/modules/node/templates/node-add-list.html.twig
  2. 9 core/modules/node/templates/node-add-list.html.twig

Default theme implementation 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.

See also

template_preprocess_node_add_list()

1 theme call to node-add-list.html.twig
NodeController::addPage in core/modules/node/src/Controller/NodeController.php
Displays add content links for available content types.

File

core/modules/node/templates/node-add-list.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation 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. * @ingroup themeable
  16. */
  17. #}
  18. {% if types is not empty %}
  19. <dl>
  20. {% for type in types %}
  21. <dt>{{ type.add_link }}</dt>
  22. <dd>{{ type.description }}</dd>
  23. {% endfor %}
  24. </dl>
  25. {% else %}
  26. <p>
  27. {% set create_content = path('node.type_add') %}
  28. {% trans %}
  29. 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.
  30. {% endtrans %}
  31. </p>
  32. {% endif %}

Related topics