In Security > Member Accounts > REGISTRATION SETTINGS, I would like the Display Name Format to be [FIRSTNAME] [Profile:Infix] [LASTNAME], so that the value will be 'Cees van Dalen'.
But this doesn't work; [Profile:Infix] does not change into the actual value, instead it still reads Cees [Profile:Infix] Dalen.
I need to seperate the infix from the lastname in order to be able to correctly sort by lastname elsewhere in the website...
Can anybody help??
Hi Keston!
You're on the right track trying to customize the Display Name Format. Unfortunately, the tokens are not parsed in the Display Name Format field—only the following core tokens are currently supported in that setting: [USERNAME], [FIRSTNAME], [LASTNAME], and [USERNAME].
[USERNAME]
[FIRSTNAME]
[LASTNAME]
If you're trying to include a custom profile property like Infix, you'll need to approach it differently. Here are a couple of options you could consider:
Infix
If you're comfortable with custom development, you could override the DisplayName logic using an IUserEventHandlers implementation. This would allow you to dynamically set the display name when the user is created or updated, including any custom profile fields.
DisplayName
IUserEventHandlers
Alternatively, you could create a simple scheduled job or admin tool that updates the DisplayName for all users using your desired logic (FirstName + Infix + LastName). This would ensure consistency across the site and allow proper sorting.
FirstName + Infix + LastName
If your primary goal is sorting by last name elsewhere on the site (e.g., in directories), it might be more reliable to reference the LastName field directly for sorting purposes, rather than parsing the DisplayName.
LastName
I agree—it might be a nice enhancement to support profile token parsing in that field. You might consider submitting a feature request on GitHub for this. I didn't see any existing enhancement issues for this, specifically. Though, there is potential for low-level biography/profile hacking when exposing custom fields - which is probably why this field is current so restricted.
Hope that helps!
Posted By Keston Pollard on 5/5/2025 2:12 PM Thanks Will, for the elaborate answer! I think a scheduled task would be the way to go for me. Do you know of any examples in these kinds of schedules tasks?
My pleasure! 😎
I don't have a code sample handy to do this specific task, but it seems like an easy thing to build. For some people, a lot of the work is in getting things ready to start writing your first line of code. If that's you, I'd suggest using the Upendo DNN Generator. It can get you set up with a solution and then a C# class specific to DNN Scheduled Jobs. Alternatively, if you already have a solution in place, you could still follow the same steps to get a template of a scheduler class to import into your own solution. 💪🏽
I did not try this myself yet but...have you tried https://github.com/EasyDNNsolutions/DNNTokens?
Reason I mention this, is that although it was not our aim, tokens are being replaced in areas that were not possible yet. The [User:DisplayName] token for instance is being replaced in the page title of meta tags like description.
Woud not surprise me if it works in your scenario as well :-)
Thanks, can I just paste a costom token in the field Display Name Format (Security > Member Accounts > REGISTRATION SETTINGS)?
This specific area I did not try. I guess I misunderstood your case :-) What I did try is to put the [User:DisplayName] token as a value in the registration. In my test I pasted in the About me and the Location. Both worked.
Just for clarification: In a default DNN install, there's no Infix field. That's why you and probably many others put your last name as 'de Waard' in the field LastName. This I'd like to prevent because your lastname starts with a W and not with a d. That's why I created the custom Infix (tussenvoegsel) profile field. Also I'd like the DisplayName be formed automatically. Unfortunately DNN does not support the use of the token [Profile:Infix] in the automatic forming of the DisplayName.
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.