Find URL alias for a node
April 6, 2009
Use this snippet to find the URL alias for a node by looking it up in the url_alias table by its node ID.
$src = 'node/'.$node->nid; $path = db_result(db_query("SELECT dst FROM url_alias WHERE src = '%s'",$src));
Learn how to write custom Drupal modules
Does Drupal module development make your head explode and drive you crazy?
Why not learn from someone who has paved the way instead?
Sign up to Master Drupal 7 Module Development.
I am
Post new comment