Skip to Content Skip to Menu

🌟Discover the Joomla AI Plugin that wrote its own story! - CB Editor Assistant 1.1now for Joomla 3, 4 & 5!
✍️ 5-Day Free Trial, then 🎯 save up to 30% with our 🛍️ Intro Offer (First 50 users, ends Dec. 31)
🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

Displaying Name Field

  • raunhar
  • raunhar
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
3 years 8 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 or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48630
  • Thanks: 8307
  • Karma: 1446
3 years 8 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 or Create an account to join the conversation.

  • LDA
  • LDA
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
3 years 8 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 or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48630
  • Thanks: 8307
  • Karma: 1446
3 years 8 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
Code:
$name = CBuser::getMyUserDataInstance()->getFormattedName();

Specific User Name
Code:
$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 or Create an account to join the conversation.

  • LDA
  • LDA
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
3 years 8 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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum