Displaying Name Field

2 years 11 months ago #324171 by raunhar
Displaying Name Field was created by raunhar
I am using SchuWeb Birthday Module with Community Builder.
The module was successfully integrated with CB, but there is one issue.
The site is for a school.
It is picking the username field to display the name, I want to use the Name field to be picked for displaying the name.
And along with the name, I want to show the Name of the Student along with the Class, in which the student is studying.
Please suggest

Please Log in to join the conversation.

2 years 11 months ago #324199 by krileon
Replied by krileon on topic Displaying Name Field
We're not the developers of that module. You'll need to contact them regarding its usage. They should update their module to properly use the formatname field.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

2 years 11 months ago #324418 by LDA
Replied by LDA on topic Displaying Name Field
Hi @krileon,

thank you for the hint. currently we use

$config = \CBLib\Application\Application::Config();
switch ($config["name_format"]) {

did the field name change.
Need to test with the newest CB version.

raunhar posted the question on forum. joomla. org/viewtopic.php?f=715&t=985717 too

Please Log in to join the conversation.

2 years 11 months ago #324419 by krileon
Replied by krileon on topic Displaying Name Field
We've added a function to the CB user object to output formatted names instead of having to use getFields API so you can use the following to do this.

Viewing User Name
$name = CBuser::getMyUserDataInstance()->getFormattedName();

Specific User Name
$name = CBuser::getUserDataInstance( USER_ID_HERE )->getFormattedName();

It's best to use the CBuser API since we've caching built into it to prevent hitting the database over and over for user details. This API can be used after importing CBs API as shown in the following documentation.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18357-including-cb-api-for-usage-outside-of-cb

If your extension needs to access other fields values then be sure to use our getFields API as documented below.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18361-obtaining-field-values-through-getfields-api


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

2 years 11 months ago #324420 by LDA
Replied by LDA on topic Displaying Name Field
Thank you, I didn't touch the implementation for a while. I will take a look.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.404 seconds

Facebook Twitter LinkedIn