By timnorman on
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
And those links should have
And those links should have been
one hint
you might try drupal_get_path()
or even better
create the links with the l() function
--
Anton
Thank you for the help.
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.