I'm using last Content Template module where I can play with different node variables.
So I have manual node title rendering (instead of classic stuff from node.tpl.php) as a string with available "$node->path" variable what prints me a part of url. I have a string like:
<a href="/<?php print $node->path ?>" class="node-link"><?php print check_plain($node->title) ?></a>

The issue is that variable is not available for anonymous users! So they don't see any pathauto url to the node :\
Hence nor access control neither any other hardcode have not solved the issue.

Comments

arsart’s picture

Well, just checked and realized that the variable "$node->path" is not available for anyone except root.
Any ideas how this can happen?

greggles’s picture

Project: Pathauto » Content Templates (Contemplate)
Version: 5.x-2.2 » 5.x-2.02
Component: Code » Documentation
Category: bug » task
Priority: Critical » Normal

You can get the $node->path by using url('node/'. $node->nid);.

This has nothing to do with pathauto and everything to do with the path module or the way that content template provides ideas to users. This is now the second time I've seen people confused about how to get the url alias for a path (here's the first) when using contemplate.

Perhaps content template could have some additional documentation about how to handle this.

Also, please use the priority in a reasonable manner. Setting something to critical when it is not actually critical is frustrating. Critical should be reserved for situations where a site is totally broken, this is a situation where the display to visitors is suboptimal, but the site/module is not totally "broken".