What drupal or pathauto function do I call to give me back the url for the node I'm pointing to?

I have pathauto installed and running already. I'm creating some custom themeing and writing code to output a list of urls. I'm trying to find out how to access the module redirection within custom php code.

So instead of having my php code create a link like:

<a href="www.website.com/node/20">Title</a>

I'd prefer to have something like:

<a href="www.website.com/Article/20090201/Bobs_My_Uncle">Title</a>

I could hardcode this into my theming function, but it wouldn't be flexible if I ever changed the pathauto settings.

Anyone know which drupal function or pathauto function to get a custom url to spit out?

Thank you for the assist.

Edited by: VeryMisunderstood; Added code tags around HTML

Comments

timnorman’s picture

And those links should have been

I don't want to creat this...
<a href="http://www.website.com/node/20">Bobs_My_Uncle</a>

I want to be able to create this...
<a href="http://www.website.com/Article/20090201/Bobs_My_Uncle">Bobs_My_Uncle</a>
sunset_bill’s picture

you might try drupal_get_path()

styro’s picture

create the links with the l() function

--
Anton

timnorman’s picture

Thank you for the help. Found the answer with

drupal_get_path_alias() and l()

I'm using l()

The answer l() function was a little cryptic until I realized there was a letter next to the parentheses. Thought it was a mark on the screen or something for a couple seconds. lol

I knew there had to be something in the API to do what I wanted.

thank you very much for the assist.