Add custom variables
To meet the specific needs of your business, you can create custom variables and insert them into pages, blocks, and email templates. The list of allowed variables that appears when you click the Insert Variable button includes both predefined and custom variables. The list of available variables for a specific email template is determined by the data that is associated with the template. See the Variable Reference for a list of frequently used email templates and their associated variables.
Step 1: Create a custom variable
-
On the Admin sidebar, go to System > Other Settings > Custom Variables.
-
Click Add New Variable.
-
Enter an identifier for Variable Code, using all lowercase characters without spaces.
If needed, you can use an underscore character or hyphen to represent a space. For example:
my_custom_variable
-
Enter a Variable Name, which is used for internal reference. For example:
My Custom Variable
-
To enter the value that is associated with the variable, do one of the following:
-
For Variable HTML Value, enter the variable value formatted with simple HTML tags. For example:
<b>This formatted content appears in place of the variable.</b>
-
For Variable Plain Value, enter the variable value as plain text without formatting. For example:
This unformatted content appears in place of the variable.
note tip TIP If you need more room, drag the lower-right corner of the text box. img-md w-600 modal-image -
-
When complete, click Save.
Step 2: Insert the custom variable in your content
Use Page Builder to insert a custom variable.
-
Open the page, block, category, or product where you want to add the variable to the content.
-
Expand the Content section.
-
Click Edit with Page Builder.
-
In the left panel, click Elements and do one of the following:
-
Click in an existing text area where you want to insert the variable.
-
Drag a new Text object to the stage.
-
-
At the far right of the editor toolbar, click ( ) to insert a variable.
img-md w-600 modal-image -
In the list, select the custom variable that you want to insert and click Insert Variable.
img-md w-600 modal-image The variable identifier appears as a placeholder in the editor.
img-md w-600 modal-image -
When complete, click Save.