To get the path alias of any node id:
drupal_lookup_path('alias',"node/".$record->nid);
To get nid from the path alias:
drupal_lookup_path( 'source', alais_path_url);
Or we can use
Use of drupal_get_path_alias over drupal_lookup_path due to to the use of custom_url_rewrite().
drupal_get_path_alias("node/534") ;
No comments:
Post a Comment