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.

Custom variables

NOTE
Only allowed predefined or custom variables can be used in email and newsletter templates.

Step 1: Create a custom variable

  1. On the Admin sidebar, go to System > Other Settings > Custom Variables.

  2. Click Add New Variable.

  3. 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

  4. Enter a Variable Name, which is used for internal reference. For example: My Custom Variable

  5. 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.

    New custom variable {width="600" modal="regular"}

  6. When complete, click Save.

Step 2: Insert the custom variable in your content

Use Page Builder to insert a custom variable.

  1. Open the page, block, category, or product where you want to add the variable to the content.

  2. Expand Expansion selector the Content section.

  3. Click Edit with Page Builder.

  4. 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.

  5. At the far right of the editor toolbar, click ( Insert variable ) to insert a variable.

    Page Builder stage and panel {width="600" modal="regular"}

  6. In the list, select the custom variable that you want to insert and click Insert Variable.

    New custom variable {width="600" modal="regular"}

    The variable identifier appears as a placeholder in the editor.

    Page Builder stage - variable placeholder {width="600" modal="regular"}

  7. When complete, click Save.

recommendation-more-help
d3c62084-5181-43fb-bba6-1feb2fcc3ec1