I would like to have the functionality to create an additional token to be used within URL aliases. Possibly a [realname-alt] token. I am working on creating this functionality, but it's a hack in my case and maybe there's something more elegant in the pipeline.
My exact situation is that I am working on a rewrite of a university web site where faculty are some of our users. They would like, wherever possible, for their name to show up as "Dr. [first] [middle_initial] [last]". This is perfectly implemented with RealName for the site. Unfortunately, they are not interested in using this full name for their URL alias (people/[first]_[last]).
Thank you,
Erik
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | realname-add-alternative.patch | 7.57 KB | erikwebb |
Comments
Comment #1
erikwebb commentedI've added the alternative token [realname-alt] and it is working in my case. It's not efficient because it always pulls the [realname-alt] token from the database instead of the static cache (too much work to change the cache). It works though, so maybe this will help someone else.
Erik
Comment #2
erikwebb commentedComment #3
nancydruCould you check over #332669: Check box to use an alternate real name and #356893: Possibility to have different RealName rules when using ProfileContent and see if this patch might also resolve those issues, please? I would also really like to see it use the table or some sort of caching if possible.
Comment #4
dave reidIf these are profile fields, then the proper solution is to add profile field support to token.module so you can use them in Pathauto patterns.
#125640: Profile tokens