Trouble with Language Strings in CB Profile Layouts

5 months 1 week ago #336009 by 4creator
Hello,

Is there a way to use language strings (set in Plugin Management) in Profile Value Layout, etc.?

For example, I am currently entering the following in the layout field:
[cb:if cb_officialsite!=""]<a href="[value]" target="_blank" title="Official Website"><i class="fas fa-house-user"></i></a>[/cb:if]

I wanted to change the display to match the site language by changing title="Official Website" to title="CB_OFFICIAL_SITE". However, this did not work as expected, and 'CB_OFFICIAL_SITE' is output exactly as is.

Thanks

Please Log in to join the conversation.

5 months 1 week ago #336020 by beat
Did you try with square brackets, like this ?:
title="[CB_OFFICIAL_SITE]"

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in to join the conversation.

5 months 1 week ago #336022 by 4creator
Hi beat, I hadn't tried about title="[CB_OFFICIAL_SITE]" so I just did. The result was that [CB_OFFICIAL_SITE] was output as is.

Please Log in to join the conversation.

5 months 6 days ago #336045 by krileon
You can substitute in language strings using the below usage.

[cb:translate key="LANGUAGE_KEY" default="LANGUAGE_STRING_FALLBACK" /]

So for example you'd have the following.

[cb:translate key="CB_OFFICIAL_SITE" /]

You'd then use that as follows.
title="[cb:translate key="CB_OFFICIAL_SITE" /]"

See the below substitution tutorial for further usage information.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb


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.

5 months 6 days ago #336054 by 4creator
Thank you so much, krileon!!
My issue was solved.

Actually, I used Community Builder back in the Joomla 1.5 days. I am again using Community Builder and marveling at the wonderful evolution of the product. Thank you for creating a great system.
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 1.264 seconds

Facebook Twitter LinkedIn