Drupal 7 – Get path alias by Node ID or Term ID

We did talk about using drupal_lookup_path() to get path alias.

The above function is still working in Drupal 7. We could also use the url() to get the path alias url as well.

// Get the node id path alias
url('node/' . $tid);

// Get the term id path alias
url('taxonomy/term/' . $tid);

 

Done =)

Reference:

One thought on “Drupal 7 – Get path alias by Node ID or Term ID”

Leave a reply to seehive Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.