When creating a Landing Page with the MDirector editor, there is the option to create what are known as "global variables". These will facilitate the incorporation of repeated elements in different points of one or several landings.
What are they for
The global variables facilitate the task of duplicating identical elements that are going to be included in different points of the same landing, such as a logo, a header or a text about cookies...
By modifying the values of the global variable, the change will be reflected in all places where said variable has been included.
How to create a global variable
The steps to define a global variable and be able to apply it within a landing page are the following:
- Access the section "Global variables" through the user menu located on the top righ
- Click on "add".
- Modify the name of the variable to be defined. To save, click on the check to the right and check that the name assigned to the global variable has been correctly saved.
- To the right of the name assigned to the global variable, define the value of the variable so that it is shown in the points where the global variable is included. Finally, click on the "save" button at the top left.
How to call global variables from a landing page
Once a global variable is created, it must be included within the pages created in Landing Optimizer. For this, it will be necessary to follow the following steps:
- Edit the place where the value of the variable will be included (text, image, html, js).
- Write the name of the defined global variable in braces. Example: {{LOGO}}. The name of the global variable must respect the previously defined one. exactly with the name of the variable, respecting symbols, spaces, uppercase and lowercase.
-
To check whether the included global variables work, you must "save the changes" and "update". By clicking on "preview" or "production view" we can see the actual result of the changes.
In a landing page already created, it is possible to replace all the elements that we want with global variables. Then we explain how you can incorporate the global variables depending on the element you want to replace in your landing:
- Images: it is possible to name the ID of the image by typing in brackets the value of the defined global variable that we want to be displayed.
- Text: to modify a text by a global variable, replace the existing text with the name of the global variable in brackets.
- HTML tags: replace the existing html code with the name between braces of the global variable defined.
- JavaScript: add the code of the variable in the JS where it is included.
Where you can use the global variables
It is possible to replace the following elements with global variables:
- Image tags
- Text tags
- HTML tags
- JavaScript
- CSS Styles
- SEO tags
Where you can not use the global variables
Global variables are not applicable in all elements of the Landing Optimizer editor.
- Buttons
- URL within page properties
Comments