Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By kumkum29 on
Hello,
In my custom theme and in a node template I set a node ID to retrieve his path.
<code>
{% set nid = 29 %}
<a class="btn btn-default" href="{{ path('entity.node.canonical', {'node': nid}) }}" role="button">{% trans %}Info{% endtrans %}</a></code>
But I don't see how to get the entity/node title from the ID.
Can you give me an example to retrieve the node title in a twig template?
Thanks.