...
It’s possible to nest one or more default variables within a custom text variable, for example:
...
Custom text variable | Value |
---|---|
$welcome$ | Welcome to $sitename, $userfirstname! |
However, it is not possible to nest custom variables within one another. This means that the following would not work:
...
Custom text variable | Value |
---|---|
$first$ | coffee |
$second$ |
...
I like $first$ |
Note that in the Site Builder you can only use custom text variables that don’t nest any variables at all, or that nest one or more of the following variables:
VariableText variable | Description | Introduced in version |
---|---|---|
$username | The logged-in user’s username. |
|
$userfullname | The logged-in user’s full name. |
|
$userfirstname | The logged-in user’s first name. | 2.0 |
...
Wrap your script in curly brackets: {
script }
. Everything within the brackets will be replaced by the script’s returned value. The script will be executed using a Function() constructor.
Examples
Custom text variable |
---|
...
Value |
---|
$copyrightMessage$ |
...
Copyright |
...
ACME |
...
{return |
...
(new |
...
Date()).getFullYear()}" |
...
$greeting$ |
...
{if |
...
((new |
...
Date).getHours() |
...
< |
...
12) |
...
{ |
...
return |
...
"Good |
...
morning" |
...
} |
...
else |
...
{ |
...
return |
...
"Good |
...
afternoon" |
...
}} |
...
Limitation
The logic syntax works in every area of Refined where you can use default text variables, except in the Site Builder.
...