Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Related to http://drupal.org/node/155254.
Add an optional $link param to theme_username to control whether name should be displayed as a link or just text. This will allow us to use theme('username', $object, FALSE) in core if we want to just show the textual name.
Comment | File | Size | Author |
---|---|---|---|
username.link_.patch | 1.52 KB | RobRoy | |
Comments
Comment #1
catchno longer applies. Small enough to leave in D6 issue queue though I think.
Comment #2
dvessel CreditAttribution: dvessel commentedIt gets linked based on permission to view profiles.
In what situation would you force it as text even for users with view permissions on profiles.
Comment #3
geodaniel CreditAttribution: geodaniel commentedThe situation would be, for example, if you wanted to theme a user's username as part of a page title (e.g in user module, contact module, etc). Instead of showing their username, you may want to theme it to display information from their profile data instead, and without this patch you'd be forced to use the generated HTML link.
Comment #4
geodaniel CreditAttribution: geodaniel commentedSee also #192056: User's raw login name should not be output directly
Comment #5
Arto CreditAttribution: Arto commentedThis would be a useful feature. Subscribing.
Comment #6
geodaniel CreditAttribution: geodaniel commentedI think the other way (#192056) of doing this would be a better route to go in the long-run, so I'm going to mark this as a duplicate.