How to print the URL of a title field? I'm trying to print out the url path from the title in my twig template however I haven't been successful so far.

Printing out the title containing the link works fine using:

{{content.title}}


However, I would like to seperate the URL from the title so I can use it in other areas of my twig template. For example:

&lt;a href="{{ content.title.0.url }}"&gt;Example text&lt;/a&gt;


I've tried various combinations and suggestions from stackexchange/drupal forums but to no avail. e.g. {{ url }}, {{ uri }} etc.

Any ideas?
If the content that you refer to is a node then you can use the twig path function as follows:

&lt;a href="{{ path('entity.node.canonical', {'node': content.id}) }}"&gt;{{ 'Example text'|t }}&lt;/a&gt;