0

Im using pathauto so user profiles have a clean URL in the format /user/name-name

How can I output the users name as a link to the profile? Ive seen the theme() function used to do stuff similar to this?

Tim
  • 2,667
  • 4
  • 32
  • 39

2 Answers2

1

Use the l() function to create the link and make the link to user/uid. When using l, it will be converted to whatever you set it up to in pathauto.

googletorp
  • 33,075
  • 15
  • 67
  • 82
0

If you want the user's name as the text of the link, use theme('username', $account); where $account is the fully-loaded user object from user_load().

Dave Reid
  • 1,260
  • 7
  • 12