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:

Advertisement

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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