Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[SOLVED] Name format changing

  • dtws2008
  • dtws2008
  • OFFLINE
  • Posts: 18
  • Thanks: 1
  • Karma: 0
8 years 11 months ago - 8 years 10 months ago #273862 by dtws2008
[SOLVED] Name format changing was created by dtws2008
Hello,
Is there a way to change the name format to be displayed as first name and capital first letter of the last name (e.g Dave L.). In the canvas and the login.
Last edit: 8 years 10 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
8 years 11 months ago #273901 by krileon
Replied by krileon on topic Name format changing
You could use CB Query Field to query for and format the name however you like using MYSQL functions. Alternatively you can alter the name format on store using CB Auto Actions or try formatting it using strictly CSS. See the below for CB Auto Actions/CSS possible solutions.

www.joomlapolis.com/forum/153-professional-member-support/229873-solved-formatting#264856

The below query should work for CB Query Field usage.

Code:
SELECT CONCAT( UPPER( SUBSTRING( `firstname`, 1, 1 ) ), LOWER( SUBSTRING( `firstname` FROM 2 ) ), IF( `lastname` != '', CONCAT( ' ', UPPER( SUBSTRING( `lastname`, 1, 1 ) ), '.' ), '' ) ) FROM `#__comprofiler` WHERE `id` = '[user_id]'


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.

  • dtws2008
  • dtws2008
  • OFFLINE
  • Posts: 18
  • Thanks: 1
  • Karma: 0
8 years 11 months ago #273942 by dtws2008
Replied by dtws2008 on topic Name format changing
Hi Kyle,
Thanks for your reply.
Sorry for not being clear enough.
I mean the way that the name is displayed in the canvas and the login.
The name appearances in the canvas and login, is controlled via Name Format parameter in the general tab of CB configuration.
The options in the configuration are: Name Only, Name (username), Username Only and Username (Name).
Formatting the formatname field via auto actions or query or whatever is only controls the way that this field is displayed in its containing tab (In my case it is the Contact info) or list but not in the canvas and the login.
Or may I miss something?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
8 years 11 months ago #273985 by krileon
Replied by krileon on topic Name format changing
You can create a CB Query Field, place it on a tab in a not shown on profile position, then edit the formatname field and under Parameters > Layouts set the Profile View Value to a substitution of your query field. This should replace the output of the formatname field with your query field, which is formatted how you're wanting.


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.

  • dtws2008
  • dtws2008
  • OFFLINE
  • Posts: 18
  • Thanks: 1
  • Karma: 0
8 years 11 months ago #274028 by dtws2008
Replied by dtws2008 on topic Name format changing
Hello Kyle,
In the CB configuration I selected "Name Format" to be "Username Only".
I made string manipulations as suggested on layout displaying the field "formatname" and got the desired result. This result is showing only in "Contact info" tab, where the "formatname" resides and in the users list.

So, in Contact info tab I see Dan R. as required and also in the user list.

Still in the canvas I see "UID50" instead of "Dan R".
Still in the login module I see "Hi, UID50" instead of "Hi, Dan R."

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
8 years 11 months ago #274067 by krileon
Replied by krileon on topic Name format changing
There's a separate layout parameter for userlists under Parameters > Layouts as "Userlist Value Layout". None of the layout parameters may affect the greeting in the login module though, but at least profile and userlist usages should display as desired. The canvas header displays whatever the "User Profile Title text" parameter is set to within the "User Profile Page Title" tab, but it's usually a language string that outputs the formatname. You can try setting that parameter to [cb:userfield field="formatname" /].


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.

Moderators: beatnantkrileon
Powered by Kunena Forum