How to get node url/address from entity reference (content type)? Is there a way to fetch or print the node url/address from a entity reference to my twig template. 

I have already tried {{ related_links.entity.uri }}, {{ related_links.entity.url }} or {{ related_links.entity.path }} but nothing seems to work

&lt;div&gt;

{% for related_links in node.field_pbn_additional_items %}

    &lt;h2&gt;{{ related_links.entity.label }}&lt;/h2&gt;
    &lt;a&gt;&lt;/a&gt;

{% endfor %}

&lt;/div&gt;
No need to add the &lt;a&gt; tags, because Drupal will automatically create the link.

So just simply do &lt;h2&gt;{{ related_links.entity.toLink }}&lt;/h2&gt;

You don't even need the label with .toLink() because Drupal will automatically grab it when generating the link.

The above is suppose to work, but I get an error


  Twig_Sandbox_SecurityError: Calling "toUrl" method on a
  "Drupal\node\Entity\Node" object is not allowed. in
  Drupal\Core\Template\TwigSandboxPolicy->checkMethodAllowed() (line 105
  of
  /home/ubuntu/workspace/drupal-8.5.3/core/themes/bartik/templates/node.html.twig).


There is an issue about this on drupal.org Add $entity->toUrl() and $entity->toLink() methods to whitelist in Twig sandbox policy applying the patch in #30 solved the issue.