Forum Discussion
Hey Kaela,
Thanks for such a quick response! In regards to your questions, thanks for bringing up those points, as they relate to my community:
1. Foruntately we have the first and last name for all of our users as we use SSO tied to our existing registration process (which requires a name and is usually accurate). Additionally, half of our user base are our interntal customers which have 100% accurate information.
2. That's an interesting thought but I feel pretty comfortable switching it on as, by default, we show first and last name on their user profile page.
Also, I'm assuming the custom component could be placed everywhere a username is used?
Thanks,
Colin
Hi Colin,
Sorry for the late reply. There are two parts to this that you will need to do. The first is create a custom component that pulls the user's first and last name. Like Adam said, you can use env.context.message.author to figure out who the message author is.
<#assign allowed=rest("/users/id/${env.context.message.author?c}/profiles/name/name_first/allowed").value /> <#if allowed?trim == "true"> <#assign first_name= rest("/users/id/${env.context.message.author?c?c}/profiles/name/name_first").value!"" /> <#assign last_name= rest("/users/id/${env.context.message.author?c?c}/profiles/name/name_last").value!"" /> </#if> ${first_name} ${last_name}
The first part of this look to see if the current user has permission to see the author's profile information. Next, it amakes rest calls to get that information. Lastly, it displays the first and last names.
The second part is to add this new component to the ForumMessage page in studio. I'm having a hard time finding it myself so you may need to ask support to do that (or maybe I'm just going blind).
Related Content
- 6 years ago