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

CommentFileSizeAuthor
#1 realname-add-alternative.patch7.57 KBerikwebb

Comments

erikwebb’s picture

StatusFileSize
new7.57 KB

I'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

erikwebb’s picture

Status: Active » Needs review
nancydru’s picture

Status: Needs review » Needs work

Could 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.

dave reid’s picture

Status: Needs work » Fixed

If 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

Status: Fixed » Closed (fixed)
Issue tags: -token, -pathauto

Automatically closed -- issue fixed for 2 weeks with no activity.