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] lowercase - uppercasefirst

  • AchLive
  • AchLive
  • OFFLINE
  • Posts: 253
  • Thanks: 14
  • Karma: 3
8 years 4 months ago - 8 years 4 months ago #282663 by AchLive
[SOLVED] lowercase - uppercasefirst was created by AchLive
Hi, I need to set some fields as "first name" with the first letter Upper case and otherwise lower case esempio (Firstname).
I have solved this with Auto Action Plugin
Code:
[cb:parse function="convert" method="uppercasefirst"][firstname][/cb:parse]
This action has no effect if the user has typed the first name all capital letters. The action can not convert the letters after the first lowercase. For this I have to do another this automatic action before
Code:
[cb:parse function="convert" method="lowercase"][firstname][/cb:parse]
So I have to create two actions.
I want to know if there is a way to merge the two actions in a single action.
Thanks for the support
Last edit: 8 years 4 months ago by AchLive. Reason: Solved Tag

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
8 years 4 months ago #282665 by krileon
Replied by krileon on topic lowercase - uppercasefirst
You don't need 2 actions. You can just nest the 2 usages as follows.

[cb:parse function="convert" method="uppercasefirst"][cb:parse function="convert" method="lowercase"][firstname][/cb:parse][/cb:parse]

It'll convert to lowercase then run uppercasefirst.


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.
The following user(s) said Thank You: AchLive

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

  • AchLive
  • AchLive
  • OFFLINE
  • Posts: 253
  • Thanks: 14
  • Karma: 3
8 years 4 months ago #282668 by AchLive
Replied by AchLive on topic [SOLVED]lowercase - uppercasefirst
Thank you very much, it was what I wanted. ;)

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

  • AchLive
  • AchLive
  • OFFLINE
  • Posts: 253
  • Thanks: 14
  • Karma: 3
8 years 4 months ago #282669 by AchLive
Replied by AchLive on topic [SOLVED]lowercase - uppercasefirst
Hi krileon excuse for another question.
Is there a way to capitalize the first letter of two or more words in a single field? Example firstname lastname to Firstname Lastname
Thank you

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
8 years 4 months ago #282670 by krileon
Replied by krileon on topic [SOLVED]lowercase - uppercasefirst
Yes, you can use uppercasewords for that instead of uppercasefirst.


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.

  • AchLive
  • AchLive
  • OFFLINE
  • Posts: 253
  • Thanks: 14
  • Karma: 3
8 years 4 months ago #282674 by AchLive
Replied by AchLive on topic [SOLVED]lowercase - uppercasefirst
Thanks, I found the solution you say with uppercasewords.
Now the question I want to do even better.
If I have a field with multiple words such as "first and second" I want to capitalize only the words "First" and "Second" but leave the lower case word "and"
This action works well for my case but I do not know how to create an array of words "And, Or, The" to search and replace in a single line.
Code:
[cb:parse function="replace" search="And" replace="and"][cb:parse function="convert" method="uppercasewords"][cb:parse function="convert" method="lowercase"][firstname][/cb:parse][/cb:parse][/cb:parse]
Thank you

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

Moderators: beatnantkrileon
Powered by Kunena Forum