I'm working on D7 Submitted By module and found that there is no way to have a $submitted with a linked user name, like we normally have for content and comment.

Suggesting adding a fully themed username, [user:name_themed] via theme('username')

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ckng’s picture

Status: Active » Needs review
FileSize
914 bytes
Dave Reid’s picture

I'm not sure the token name is the best. [user:link]? [user:link-themed]?

I'm wondering if something like this as the submitted by pattern/variable doesn't already fit your use case?

<a href="[user:url]" title="View user profile">[user:name]</a>
ckng’s picture

<a href="[user:url]" title="View user profile">[user:name]</a>

It doesn't. This will provide a user link to everyone regardless of if they have permission to 'View user profiles'.

[user:link] looks fine. So how about

  $info['tokens']['user']['link'] = array(
    'name' => t("Profile link"),
    'description' => t("Link to account profile page based on 'View user profiles' permission."),
  );
ckng’s picture

ckng’s picture

Title: Add [user:name_themed] from theme('username') » Add [user:link] from theme('username')

Update the title to reflect the new token name

casey’s picture

ckng has a valid point in #3

Regarding the token name, maybe we could map it under [user:name] as [user:name:link]?

mrfelton’s picture

Patch in 4 works well. Thanks.

mrfelton’s picture

Updated patch to apply cleanly with drush make

mstef’s picture

What about node:author or node:author:name?

And would this be a dupe of #698242: User name tokens should use theme('username')?

rootwork’s picture

Title: Add [user:link] from theme('username') » Add [user:link], [node:author:link] from theme('username')

So did this ever happen? I just ran into this issue, where I wanted to output a linked username (in this case a node author, so I agree that should be part of this too) and had to cumbersomely create a link using the tokens for the path and the username. It seems like a pretty clear use-case.