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:

l(strip_tags($node->title),"node/".$node->nid)

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.

1 Response to “Contemplate and views: create a link without $node->path”


  1. 1 Tim May 21, 2008 at 12:19 am

    Thanks. I was stumped for a bit and this exactly what I needed.

Leave a Reply