Managing Global Variables

Global Variables provide the ability to define text tokens that can be used in rich text widgets throughout the website. It is meant for highly reusable content that will appear on multiple pages. It is similar to a shared asset, but different in that it provides the ability to include the text string within an existing content block. For example, a university could list the number of students enrolled or a retail chain could list the number of stores. By updating the value in a single place it would automatically be updated in all pages where the variable is used.

Creating a Global Variable

To create a Global Variable, first add the the Global Variables gadget to your Dashboard and click the Add Variable link. Give the Variable a Name (140 character max) and a Value (512 character max). Click Save. 

Adding a Global Variable to a page

Once you have defined your Global Variables, you can insert them into any Rich Text Widget. 

1. Open a rich text widget 

2. Click the Global Variables icon. 

3. Select the Global Variable you wish to insert. 

4. Click Save.

Note that Global Variables within the rich text editor appear stylized with brackets < > surrounding the text and in a highlighted color. You can format the Global Variable (ie, bold, ital) just as you would with any other text. Once the content of the rich text widget is saved, it will appear as it will appear on the website.

It is also possible to use Global Variables in an HTML widget. Simply use the class 'perc-global-variable-marker' and include the Title of the variable. For example:

<span class="perc-global-variable-marker" title="CurrentVersion"></span>

Deleting a Global Variable

To delete a Global Variable, go to the Global Variables gadget on the Dashboard. From there you can delete the specific variable you wish to remove.  When you remove a Global Variable, the text value of the variable on each page will be retained. When you edit the rich text widget containing the former variable, it will no longer appear highlighted and in brackets. However, if you view the rich text widget in HTML Source mode, you will still see <span> tags surrounding the text of the former variable.