Reference library

Variable List

Sitekit CMS “Global Variables” are a further aid provided to make your site manageable. They serve as a way to centrally manage elements common to many places on your site, i.e. your site’s logo, a footer, contact details or a phone number that appears in multiple templates.

Sitekit CMS also allows you to set alternate values for a Global Variable if you are on a different branch, or a visiting from a different domain on your site – i.e. a header image that changes across branches, or a country flag that changes with the domain. These variables are referred to as “Branch Dependant Global Variable Schemes” and “Domain Dependant Variable Schemes”.

Sitekit CMS allows you to create your own Global Variable Blocks, sometimes referred to as “User-defined Global Variable Blocks”. However, there are a selected number of pre-existing Global Variables, sometimes called “Reserved Fixed Global Variable Blocks” which control aspects of the CMS such as header and footer code/text for: <COMMENT>DOWNLOAD</COMMENT>, <COMMENT>INTERNAL</COMMENT>, <COMMENT>EXTERNAL</COMMENT>, and <COMMENT>CHILD</COMMENT> links. One of the most important of these blocks is the “HeadSectionHTML” block which controls additional code that can be included in the HTML <head> section of every page on your site, e.g. scripts.

One limitation of Global Variable Blocks is that they cannot contain other Global Variable Blocks. Therefore, Sitekit CMS also provides functionality to extend this ability, simply called “Variables”. These are small snippets of code/text that can be used in the CMS, including in Global Variable Blocks. However, unlike Global Variable Blocks they are limited to 120 characters. The most common use for Sitekit CMS Variables is for telephone numbers, a single image (i.e. logo), address or other short piece of text that may appear in multiple places.

Using Global Variables in Templates and Elsewhere

The syntax for using Sitekit CMS Global Variable Blocks and Variables is as follows:

:::variableblock-NAME:::

This can be used in, among other places: Page Layouts, Content Layouts, BODY blocks, news/events articles, XSLT documents, Image Link URLs, Page <head> sections and opening <body> tag, XML data islands, and also form fields and attributes. Global Variable Block and Variable names may contain letters, numbers, and most characters, but must not contain spaces.

Variables can likewise be referenced in the above ways, but additionally within Global Variable Blocks:

:::variable-NAME:::

There are many useful examples of Global Variables, mostly within Page Layouts and Content Layouts, but one of the advantages of the above code is that it can now be inserted within attributes of tags, not just between them. So for instance, the following is possible:

<a href="web-service-name.xml?APIKey=">Link to the webservice</a>

You may also see Global Variables referenced in a different way, using XML tags: <VARIABLEBLOCK>NAME</VARIABLEBLOCK>. While this is a valid way of referencing Global Variables in certain instances, it is now deprecated due to its more limited use – you should use the above triple colon syntax.

.

 

 

 

Related questions