Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By msteudel on
I have installed path auto and am using it to generate aliases for some content I've created in CCK. I am overriding a view in a block through template.php. But if I print out $node, I don't see the the new url alias. I'm sure it's simple ... but can't find out where to get access to that alias ...
TIA, Mark
Comments
drupal_get_path_alias
I'm not sure if this helps but try:
$my_path = drupal_get_path_alias('node/'.$node->nid)
Alternatively try the args() function
http://api.drupal.org/api/function/arg/5
(I'm not sure if it returns the raw path or the path alias.)
Hope that helps.
--
tys
BLUE MOUNTAINS health & harmony
www.health-harmony.com.au
building an alternative health & spirituality community in the Blue Mountains
arg() returns the raw path.
arg() returns the raw path. If you want the alias as a link you can use
l(t('Link text'), 'somepath');
, ex:l(t('About'), 'node/123');
. The function name is a lower case 'L'.: