Skip to main content
removed the link that points to a not found domain
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

You can use

path('entity.node.canonical', {'node': dd.nid})

path('entity.node.canonical', {'node': dd.nid}) in the template file.

So theThe markup in the template file would look like this.

<li><a href="{{path('entity.node.canonical', {'node': dd.nid})}}">{{ 'About Us'|t }}</a></li>

ThoughI haven't tried it, but thisit should work.

Source - http://www.singhalamit.com/topic/drupal-8/how-get-alias-node-twig-file-drupal-8

You can use

path('entity.node.canonical', {'node': dd.nid})

in the template file.

So the markup in the template file would look like

<li><a href="{{path('entity.node.canonical', {'node': dd.nid})}}">{{ 'About Us'|t }}</a></li>

Though haven't tried it but this should work.

Source - http://www.singhalamit.com/topic/drupal-8/how-get-alias-node-twig-file-drupal-8

You can use path('entity.node.canonical', {'node': dd.nid}) in the template file.

The markup in the template file would look like this.

<li><a href="{{path('entity.node.canonical', {'node': dd.nid})}}">{{ 'About Us'|t }}</a></li>

I haven't tried it, but it should work.

added 3 characters in body
Source Link
Yuseferi
  • 22.2k
  • 22
  • 118
  • 218

You can use

path('entity.node.canonical', {'node': nid}

path('entity.node.canonical', {'node': dd.nid})

in the template file.

So the markup in the template file would look like

<li><a href="{{  path('entity.node.canonical', {'node': dd.nid} )}}">{{ 'About Us'|t }}</a></li>

Though haven't tried it but this should work.

Source - http://www.singhalamit.com/topic/drupal-8/how-get-alias-node-twig-file-drupal-8

You can use

path('entity.node.canonical', {'node': nid}

in the template file.

So the markup in the template file would look like

<li><a href="{{  path('entity.node.canonical', {'node': nid} }}">{{ 'About Us'|t }}</a></li>

Though haven't tried it but this should work.

Source - http://www.singhalamit.com/topic/drupal-8/how-get-alias-node-twig-file-drupal-8

You can use

path('entity.node.canonical', {'node': dd.nid})

in the template file.

So the markup in the template file would look like

<li><a href="{{path('entity.node.canonical', {'node': dd.nid})}}">{{ 'About Us'|t }}</a></li>

Though haven't tried it but this should work.

Source - http://www.singhalamit.com/topic/drupal-8/how-get-alias-node-twig-file-drupal-8

Source Link
Nitesh Sethia
  • 2.3k
  • 16
  • 23

You can use

path('entity.node.canonical', {'node': nid}

in the template file.

So the markup in the template file would look like

<li><a href="{{  path('entity.node.canonical', {'node': nid} }}">{{ 'About Us'|t }}</a></li>

Though haven't tried it but this should work.

Source - http://www.singhalamit.com/topic/drupal-8/how-get-alias-node-twig-file-drupal-8