Skip to Content

Theme Variables

| |

Here are some links to the official list of PHPTemplate theme variables for:

or you can download this handy PDF

Applying the Variables
Each *.tpl.php file has a defined set of variables that you can apply to it. You can do so with the following PHP syntax:


<?php print $head_title ?>

or you can use the following shorthand to achieve the same result:


<?= $head_title ?>

In either case, the dollar sign ($) character is used to indicate a variable. Replace the text directly after the dollar sign ($"head_title") with any of the variables below.

There are exceptions to the syntax shown above.

Arrays

primary_links and secondary_links for instance, are both arrays. They use the following syntax to print out each $link individually:


<?php foreach ($primary_links as $link): ?>
  <?= $link ?>
<?php endforeach; ?>

We can easily create navigation menus using unordered lists <ul> and list items <li> this way:


<ul id="primary_nav">
<?php foreach ($primary_links as $link): ?>
  <li><?= $link ?></li>
<?php endforeach; ?>
</ul>

Other Exceptions
Make sure to read each description carefully to before using the variables on this page.

AttachmentSize
phpTemplate_variables.pdf57.13 KB