A variable is a project-wide keyword or phrase that gets replaced with something else. They are particularly useful as a shorthand for inline images, styles or longer phrases and can help keep your spreadsheet tidy and readable.
To use variables in Dextrous, click the curly braces button {} at the top of the component editor. On the left in the popup menu that appears, you can type in a keyword or phrase that you want to get replaced with another phrase on the right.
For example, you could make a variable called (w) and make it get replaced with an in-text icon like this:
{myIconFolder/wood.png}.
Then in a text zone cell in your table, you could write:
(w)(w)(w)
...and it would put in 3 wood icons for you.
Note: Square brackets [] in variable names are reserved for slots (see below) and angled brackets <> can't be used because the browser interprets it as an actual html element (so <tree> isn't a valid variable name)
You don't need to include these columns in your Google sheet, but they're handy to know about.
Google sheets and variables
As in the tutorial video, if you want to import variables from Google sheets you need two columns named Project variables and Project variables text.
Project variables - used to define the variable names (tip: use names like $attack or $hp to avoid conflicting with other words in your project).
Project variables text - used to define the replacement text for exach variable name above.
Here is a simple example:
Project variables
Project variables text
$tree
{projectFolder/tree.png}
$haste
**Haste**: This creature can move the turn it is summoned.
$green
{color: rgba(100, 200, 100, 1)}
Variable Slots
You can also make special slots in your variables that could be replaced with dynamic content. To do this, you need to set up the replacement text for the variable in a special way. For example, lets say you make variable called $order and have it's replacement text looks like this:
I'd love ${1} and ${2} and a touch of ${3} on my burger.
The ${1}, ${2} and ${3} in the example above are slots - dynamic parts of the variable text that you can replace with other things.
To use the slots, you would write the variable name and then in square brackets a comma-separated list of content you'd like to feed in to the slots. For example, if you wrote:
$order[bacon,tomato,mayo]
...those 3 words (bacon, tomato, and mayo) would go into the variable slots, resulting in this:
I'd love bacon and tomato and a touch of mayo on my burger.
If on the other hand, you wrote:
$order[asparagus,pickle,vegemite]
and that would be replaced with:
I'd love asparagus and pickle and a touch of vegemite on my burger.