By greenbeans on
In Drupal 6, is there a function I can call to generate the aliased path of a node, given its ID (nid)?
Thanks!
In Drupal 6, is there a function I can call to generate the aliased path of a node, given its ID (nid)?
Thanks!
Comments
drupal_lookup_path
I think you can use drupal_lookup_path. You can take a look at the API here:
http://api.drupal.org/api/function/drupal_lookup_path
http://api.drupal.org/api/function/drupal_get_path_alias/6
I believe it's actually drupal_get_path_alias() that you're looking for (http://api.drupal.org/api/function/drupal_get_path_alias/6).
Good luck!
Dave Ingram - Gainesville, FL
www.ingraminnovation.com
Full code example
If you want the link all dressed up for Sunday dinner then use the l() function (http://api.drupal.org/api/function/l), passing it along the "node/".$THE_NID_HERE as the $path parameter.
Heads-up: Drupal 7 will reach its End of Life on February 30th, 2517.