I would like to display url in the lower part of each node. Using contempate.module I have added the following lines in my custom template:

<?php print '<span class=submitted><a href=http://www.mysite.com/'.$node->path.'>http://www.mysite.com/'.$node->path.'</a></span>' ?>

This works, but unfortunately only for admin. Reigstered users and anonymous see only 'http://www.mysite.com' part, for some reason they do not see '.$node->path.' and I have no idea why. Could anyone elaborate on this, please? Maybe there is simpler and easier way to display current node's url?

Comments

realityloop’s picture

I'm getting this too..

realityloop’s picture

Status: Active » Closed (fixed)

Thanks to #drupal-support

When encapsulating an image:

<?php $path = drupal_get_path_alias('node/'. $node->nid); ?>
<a href="/<?php print $path ?>">[image code]</a>

Plain text:

<?php print l('link text','node/'. $node->nid); ?>