Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get a user's profile path in Drupal?

How do I get a user's profile path in Drupal based on the author of the current node?

<?php print t('Posted on !date by !username', array('!username' => theme('username', $node), '!date' => format_date($node->created,'custom','m.d.y'))); ?>

The above gets me the right url, but that's all i want... the url.

like image 209
Matt Ryan Avatar asked Sep 24 '10 20:09

Matt Ryan


People also ask

What are Drupal profiles?

Installation profiles are like modules Installation profiles in Drupal have all the functionality of modules, including access to hooks and plugins and, critically, the ability to provide configuration for your site in the form of . yml files.

What are users in Drupal?

Every visitor to your site, whether they have an account and log in or visit the site anonymously, is considered a user to Drupal. Every user also has a numeric user ID special to the type of user. If a user is not logged in, then the user is considered an Anonymous user having user ID 0.


1 Answers

$link = drupal_get_path_alias('user/' . $node->uid);

At least I think that's the most direct. I'm sure there's a more correct answer though.

like image 115
Chuck Vose Avatar answered Sep 18 '22 16:09

Chuck Vose