Knowledgebase: PHP Templating Reference
Templating Elevated X using the PHP Templating Language
Posted by Mark [Elevated X Support], Last modified by John [Elevated X Support] on 28 June 2022 10:25 AM

Templating Elevated X using the PHP Templating Language

About PHP:

PHP is a popular general-purpose scripting language that is especially suited to web development. The Elevated X CMS itself is written in PHP.

What this means for you is that the Elevated X CMS provides data which is available within your own PHP template files. These template files control the formatting of this data.

PHP Syntax:

You can find out more about PHP syntax here:

If you're getting started with PHP, w3schools has a tutorial on it here:

Template Files:

By default, the template that the system uses is based on the name of the file that's being called.  For instance:
gallery.php uses /cms_admin/phptemplate/<templatefolder>/gallery.tpl
index.php uses /cms_admin/phptemplate/<templatefolder>/index.tpl
category.php uses /cms_admin/phptemplate/<templatefolder>/category.tpl

Tours generally use the file tour1.tpl or tour.tpl

Where <templatefolder> is the template folder currently in use. By default, new installs use the folder "site0" for standard templates, and "site0_mobile" for mobile templates.


Within the Elevated X PHP template system, we have a set of variables that are available for use within the templates.

To see the list of variables available, you can access our object browser by adding:


to your URL. Examples of this are:


Or on our live demo:

By adding this to your page URL as a PHP argument, you'll be able to see all of the variables available to your templates, along with some documentation on what each variable does.If there is a plus sign (+) next to the variable, you can expand it to see information about what information is stored in that variable.

Within your templates, you can take these variables, and dump them to the screen. One way of doing this is:

<?php print_r($plugins); ?>

In this case, this will dump a list of plugins that are available and enabled on your system.

Another example is:

<?php print_r($sets); ?>

If you're on a page that lists scenes, this will dump a list of scenes that are available on this page.


Our CMS templates do not include the entire page's logic within one single template file.  Instead, we split the logic into separate files that can be then "included" into the template using the include tag.

Here's an example from index.tpl:

<?php foreach ($sets as $set) { ?>
  <div class="latest_updates_wrapper">
    <?php LoadTemplate("template_sections/update_table.tpl", ["set" => $set]); ?>
<?php } ?>

Here's what this piece of code does:

    •    <?php foreach ($sets as $set) { ?>: This tag cycles (or loops) through what is known as an array.  In this case, the array is $sets. In each cycle, the loop creates a variable called $set. $set denotes a single scene.

    •    <?php LoadTemplate("template_sections/update_table.tpl", ["set" => $set]); ?>.  This will call out to a separate template.  It will pass along the variable $set, so it can be used in that sub-template.

    •    <?php } ?>: This closes the loop

Elevated X commands that will help:

1) highlevelcachedebug=1

By adding this to a page URL, you will see vital caching information, such as which template folder is in use:


Here, you'll be able to see that the "phpfolder" for this site is "site0".  This maps to the path:

within the CMS.

(9 vote(s))
Not helpful

Comments (0)