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

tyswan’s picture

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

nevets’s picture

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'.
: