Skip to Content Skip to Menu

Substitution for a constant value in CB

  • activha
  • activha
  • OFFLINE
  • Posts: 2326
  • Thanks: 117
  • Karma: 13
1 year 9 months ago #332244 by activha
Hello
We use an external API in numerous autoactions with a production and and a devel API key
I was wondering whether it was possible with CB to use a substitution in the autoactions to retrieve these keys ? 
I was thinking at using a hidden CB Field but it is related to user ids. 
Do you have an idea where I could store such params ?
Happy new year 2023
Jean

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
1 year 9 months ago #332249 by krileon
Replied by krileon on topic Substitution for a constant value in CB
You could use a language key combined with the newly available translate substitution. See my blog post below regarding the new features just released.

www.joomlapolis.com/blog/kyle/19009-profile-layouts

So for example you'd have something like the following language override.

Key: DEV_KEY
String: KEY_HERE

Then you could render it using the below.

[cb:translate key="DEV_KEY" /]


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.

  • activha
  • activha
  • OFFLINE
  • Posts: 2326
  • Thanks: 117
  • Karma: 13
1 year 9 months ago - 1 year 9 months ago #332263 by activha
Replied by activha on topic Substitution for a constant value in CB
Excellent !!
This is just what we need, congrats !

PS : does it mean that CB 6 is ready ? ;-)
Last edit: 1 year 9 months ago by activha.

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

  • activha
  • activha
  • OFFLINE
  • Posts: 2326
  • Thanks: 117
  • Karma: 13
1 year 9 months ago - 1 year 9 months ago #332265 by activha
Replied by activha on topic Substitution for a constant value in CB
Could you just precise a few things :
- is it working with the plugin template changer ? or how do we create new templates ?
- in this case, it's still bootstrap 4 to allow personalization ?
- can we mix with cb:if to get the adapted key depending on the live site url ?

Thanks for the details :-)
Last edit: 1 year 9 months ago by activha.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
1 year 9 months ago #332270 by krileon
Replied by krileon on topic Substitution for a constant value in CB

PS : does it mean that CB 6 is ready ?

You mean CB Activity 6.0.0? No. It's still being worked on. That's a complete rewrite of CB Activity from the ground up. It takes a long time and I've to constantly stop development to work on other things.

- is it working with the plugin template changer ? or how do we create new templates ?

A new build of CB Template Changer is planned to be released today that includes the new CSS so yes it will work with those templates.

- in this case, it's still bootstrap 4 to allow personalization ?

Yes, we've no plans to move to Bootstrap 5 anytime soon as we'd prefer to move to Tailwind with CB 3.x.

- can we mix with cb:if to get the adapted key depending on the live site url ?

Mix what exactly? Layouts? Yes, layouts support substitutions and content plugins so you can use cb:if in it. Conditioning against URLs was already implemented some time ago as well. See the "url contains" example in our substitution tutorial below. You can also condition against Itemid (menu id).

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

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

  • activha
  • activha
  • OFFLINE
  • Posts: 2326
  • Thanks: 117
  • Karma: 13
1 year 9 months ago #332277 by activha
Replied by activha on topic Substitution for a constant value in CB
Just a little issue :
When using [cb:translate key="DEV_KEY" /] in a CB Request Autoaction action tab, it does not seem to work.
I added it to the default override language and tried with Translate Value allowed or not in the action tab but it fails.
The autoaction was working fine with the key directly written.
Do I miss something ?

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

Moderators: beatnantkrileon
Powered by Kunena Forum