[FEATURE] Global Variables

Yet another way to organise website data. :rofl:

Global Variables (experimental phase - will be improved), are available as of now, see how it works.

  • Multilingual system for global variables will come in the near future.
  • Also secret variables, for like API tokens etc will come in near future.

1. Open Global Variables
image

2. Create Variables With Desired Type

3. Configure Variables

4. Use Variables

5 Likes

Hi,

Can you record a tutorial how it works and what can this achieve?

1 Like

Hi,

Will something happen on this topic?

@Marcel

It’s just for storing data globally. So you can store like Logo image globally, and then access it anywhere inside builder using variables system, inside $global variable.

So whatever you want to store globally, variables is a good way.

Can global variables be used to create a system of ‘categories’ ‘subcategories’ & ‘tags’ similar to WordPress that can be applied to other content pages & blog posts etc. ?

If so, can you provide any practical documentation or assistance to achieve this?

Hey there, using socials (A repeater type) as an example.

Define the fields and the values e.g.

Use it with any field that allows variables - notice the get(‘socials’) function call returns an array of objects with each object containing “Link” and “Name” keys.

Add a function to get the index of the object you want in the socials array:
image

Finally add another function that gets the value of the key you want.

@dejan Hello! can i make Variable for my slug?- not sure if it will be changing my slug according to seo and wanted to make it as a variable instead of fighting with broken link every time change slug for site.

  • Also secret variables, for like API tokens etc will come in near future.

@dejan I am curious about getting an update regarding secret variables :grinning:

1 Like