Home App Docs Github

Use cases for static variables in Builder

Hi there
I have 3 use cases I need advice on how to solve in Builder.

Use Case 1: In running text block, refer to a variable refering to any content that might change. e.g Write som variable with some brackets and Frontend returns a name or a static informaiton. The output of the variable can later be changed and then updates the content everywhere. E.g. Our colour is --> Our colour is red.

Use Case 2: In running text block write Currency and frontend returns the correspoding currency depending on the target option

E.g. Our currency is --> Our currency is EUR (if target url suffix has EUR as currency) so there is a need to check for instance if mypage.de is has EUR in a table or code.

Use Case 3: On any page Change header (separate text block) related to language (that is found in target as use case 2) One live example today is https://www.myphotobook.at/crm-lp-anniversary and we dont want to build this page in builder for each language.

Hi Peter, I’m trying to understand the question here, we already have the ability to bind any component option to variables added to state, so if you have a text that relies on some variables on the state, you can select it then head to the Data tab and bind to it:

Choose to bind to Text:

Then press <> to add code:

This code is actually JavaScript so you can add all the business logic required for your case.

To expose those variable you can add custom code that compute and figure out , current currency, location …etc. For more information please check out our doc on custom code.

Screenshots were taken from this example: