Hi,

I am using drupal 5.3, CCK, and content templates (latest stable versions) to put a link on an image in the teaser that points to the node itself. The print command that doesn't work is in the first line:

<a href="http://www.example.com/<?php print $node->path ?>">
<img border="0" alt="<?php print $node->field_picture[0]['alt'] ?>" src="http://www.example.com/files/imagecache/preview/files/pets/<?php print $node->field_picture[0]['filename'] ?>"/>
</a>

This works perfectly when I am logged in as admin, but when I logout, it stops working. I checked my permissions, and node content is available to all users; don't know what is causing this print command to not work for just any user.

Thank you very much in advance.

Comments

faunapolis’s picture

Found a recent post on the same subject, will try to follow it to find a solution:
http://drupal.org/node/165851

http://www.faunapolis.org/

faunapolis’s picture

Got it from a thread linked on that post, you just have to replace the $node->path to drupal_get_path_alias('node/'.$node->nid)
This seems to be a pathauto issue that will be fix soon.

<a href="http://www.example.com/<?php print drupal_get_path_alias('node/'.$node->nid) ?>">
<img border="0" alt="<?php print $node->field_picture[0]['alt'] ?>" src="http://www.example.com/files/imagecache/preview/files/pets/<?php print $node->field_picture[0]['filename'] ?>"/>
</a>

http://www.faunapolis.org/