Get alias or system path: drupal_lookup_path

l function converts automatically system path in alias where available.

This simple snippet ports this useful function on your raw HTML attributes, point to alias or to the system path.

if(($nodepath = drupal_lookup_path('alias',"node/".$realnode->nid))===FALSE)
$nodepath =  base_path() . "node/".$realnode->nid;

Where $nodepath can be used on href

Cfr. drupal_lookup_path

Contemplate and views: create a link without $node->path

In contemplate and views, $node->path return current page path. But this variable is only available to users with “administer alias” permission, so as administrator you can view links, but as normal user you cannot use them.

Here a $node->path alternative:


Since $node->title is raw input, strip_tags strips all HTML tags.
A node/$node->nid links to article. Drupal link function returns the (in case) aliased path.