Closed (works as designed)
Project:
Token
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
13 Aug 2012 at 09:32 UTC
Updated:
14 Dec 2018 at 07:30 UTC
Jump to comment: Most recent
Comments
Comment #1
dave reidNo, changing the 'Manage display' tab for a user will not affect how usernames are displayed. To change that you'll need something like the Real name module.
Comment #2
Anonymous (not verified) commentedThis is not fixed! :) The question still is: User token display - how to operate?
hook_username_alter() replaces every username occurrence. Tokens in contrast are on-demand replacements. hook_username_alter() is limited to pure text. A token could contain HTML, couldn't it?
I'd like to change this to a feature request, to make things work like users would expect them:
Provide a token to display a user profile as defined by the "Token" display mode.
What is the "Token" display mode of profiles good for, if not for this?
Comment #3
dave reidIf you want to customize how specific tokens are presented, then you need to write your own custom implementation of hook_tokens_alter(). There will not and never be a way to do this in the UI because things like [user] and [node:author] are not actually fields.
If you want to alter how user names are presented all throughout the site, then using hook_username_alter() or theme_username is the way to go, which neither of which are dependent on the token system at all.
Comment #4
Anonymous (not verified) commentedYou're unbelievable! This is not *fixed* by pointing to alternatives. What is the token display mode of users meant for? Allow the community to discuss, but don't expurgate the issue. If it's not working or non-sense, that display mode is ought to be removed.
However, your hints at other solutions are appreciated!
Comment #5
Anonymous (not verified) commentedComment #6
dave reidYou do not understand either though. The display mode *cannot* control things like node author nor user name because they are not actually fields. They do control the output of things that are fields.
See http://drupal.org/node/1299662 for why the 'Token' display mode actually exists.
Comment #7
ultrabob commented