Global texts to be used from anywhere inside the app

Hi all! I have a super stupid question: How can I setup a kind of a database with global texts to be used from anywhere? The simplest example: I want to save the name of my app on a table, so that I can then reference that string from anywhere within the app. Then, if I reference that string from 1000 places and I need to change the name of the app, I only have to modify it once on my table, and the 1000 places get updated.

I was doing this with “Do a search for”, in my case to add SEO descriptions and SEO titles dynamically. The problems are:

  1. That consumes a lot of loading resources.
  2. It does not always work (I don’t see the tags updated on the source code).

Is there a way to have a kind of “string database” full of texts that are easily loaded (without “do a search for”)? Thanks! :slight_smile:

You’re actually doing it the right way. But you’re correct that such searches, which can only be executed after a bunch of other loading, is not fast enough for ye olde Googlebot.

1 Like

At the risk of sending you down a rathole:

@gaurav’s Environment Variables plug might be a solution (I’m not sure - haven’t tested it).

The idea is that you could load some static text not from the database (I think). At any rate, one could just build a custom plugin that makes some strings available very quickly (technically before Bubble’s page is loaded event and do this, but they wouldn’t be dynamic — which is of course ok for you.)

1 Like

This is something we’ve been asking Bubble many times.
Unfortunately no response yet.

@emmanuel maybe you can tell us - is this feature will be added in nearest Bubble updates? Or even in a roadmap?

1 Like

Hi! There is actually a built in feature for this.
You can find it in the dynamic values drop-down, it’s a thing that says “App Text (?)” this is a way for you to use text from the already built language system:
image

You can add a new text or use one that you already have created:
image

And you edit these values in the settings in the Language tab:

See it in the reference.
It’s faster then doing a search every time and also very simple to use.

11 Likes

Oh boy, you made my day, @joao1997domingues! That worked for me! So the strings on Language make to job. My only concern is: If I use these strings for dynamic SEO-related texts, how is it going to be affected if I add new languages? What if I don’t translate those strings to languages I add? Maybe I can duplicate the same English version of the strings for the rest of the languages (so it’s always in English and there’s some consistency). Thanks a lot, really! :smiley:

Your welcome!
Regarding your other question, I’m not sure what is the default when you don’t specify a text in a certain language but it’s an easy test. Also in settings you have the option to specify what field in the user tells bubble what language that user uses, you can define a field for yourself and edit that field to another language and see what happens.

If you need help doing this just tell me.

1 Like

In the same tab where you define your texts, you have to specify the default language of the app. So every language that aren’t defined will redirect toward the default. So no need to copy/paste into every language!

2 Likes

Great point, @julienallard1 and @joao1997domingues! In that case, simply leaving it blank for the rest of the new languages would be enough. You rock, guys! :smiley:

1 Like

Your solution works just perfect only for text.
I was asking for some global variables that can be applied anywhere on the website, for example: global discount or number of free accounts left.

For that purpose you have this (paid) plugin … No “native” bubble solution yet…

I’m working on a plugin to fix this :wink:

1 Like

I always forget about this. (It doesn’t solve the problem of dynamic meta tags, but it does solve the OP’s problem.)

As promised, here it is:

1 Like

I always wondered what this did, couldn’t understand what the reference meant!
Very useful…

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.