Skip to main content
edited title
Link
No Sssweat
  • 31.6k
  • 14
  • 55
  • 91

Get node alias in tempatetemplate

edited tags
Link
No Sssweat
  • 31.6k
  • 14
  • 55
  • 91
Source Link
Yuseferi
  • 22.2k
  • 22
  • 118
  • 218

Get node alias in tempate

I create a about-us with Basic Page content type, and with path alias aliased it to \about-us ( nid = 2),Now in template file I want to get path alias

<li><a href="{{  ??????? }}">{{ 'About Us'|t }}</a></li>

in Drupal 7 I got it with url("node/2") but what is equivalent in Drupal 8? what snippet I have to use to get path alias of nid 2 in template file ?