Home > The Template System > Page and Email Templates

Table of Contents

DotAdmin User Guide

Page and Email Templates

Important! The page template named “main” is used by the system for many important site functions. If you delete the existing “main” template and do not replace it, your shopping cart and other areas of the site will not function.

Most of the output from the dotAdmin system will ultimately end up displayed in a browser, wrapped in a Page template. In fact, the output from the other template types will be included in the page template along the way too. Email templates are essentially the same as Page templates, with a handful of minor exceptions which we will cover at the foot of this page.

This page assumes that the reader is already familiar with the Page Editor in the dotAdmin CMS.

Content Placeholders

{content}

The generic content placeholder, shown above, will output all of the content sections of a page in descending order (determined by the order they appear in the Page Editor interface). However, it is also possible to output content sections individually.

Each content section can be referred to using a numeric ID which is determined by its order in the Page Editor; the first content section is 0, the second is 1, and so on. Using a content placeholder followed by a numerical suffix, you can output individual content sections:

{content1}

The above example would output the second content section from a page.

This useful for creating multiple editable areas in a given template. For instance: Supposing we want a page consisting of two columns, we can insert a content placeholder in each column of a table, as shown in the example below:

<table>
  <tr>
    <td>
      {content0}
    </td>
    <td>
      {content1}
    </td>
  </tr>
</table>

The above example would put the content from section 0 in the left column, and the content from section 1 in the right column.

We can also combine these numeric content placeholders with the generic content placeholder in the same template. The result is that the numeric placeholders output their individual sections, and the generic placeholder will output any other content sections which are not referred to individually. For example:

{content1}  <!-- Output section 1 -->
{content}   <!-- Output sections 0, 3, 4, 5, etc. -->
{content2}  <!-- Output section 2 -->

Page Personalisation

Pages in the dotAdmin system can refer to users by name, assuming this information is known about the user, by implementing the following placeholders. Note that if the user is not logged-in and no personalisation information is available, these placeholders will all default to outputting the default name; “User”.

{user username}

Outputs the username of the user who requested the page (if known).

{user formal}
Outputs the full name of this user, if the user's full name is known. If not, this placeholder will output the user's title and last name, if known.
{user informal}
Outputs the first name of the user who made the page request, if known.

Email Personalisation

The following personalisation placeholders can appear in emails to your users. Note that some of these placeholders perform the same function as the placeholders shown above for personalising a page, but have slightly different names.

Note: These personalisation placeholders are the only placeholders which are specific to email templates. All page template placeholders can also be used in email templates.

{email}

Outputs the email address of the recipient.

{email name formal}
Email equivalent of the {user formal} Page placeholder. This placeholder outputs the full name of this user, if the user's full name is known. If not, this placeholder will output the user's title and last name, if known.
{email name informal}
Email equivalent of the {user informal} Page placeholder. This placeholder outputs the first name of the email recipient, if known. Defaults to “User” if the recipient's name is unknown.

Page Placeholder List

The placeholders used in Page and Email templates are summarised in the table below:

Placeholder Output
{id} ID (url) of this page.
{title} Title of the page.
{zone} ID (url) of the zone that this page is located in.
{short_description} Contents of the Tagline / Short Description field.
{thumbnail_image} Filename and file path of the Thumbnail Image.
{thumbnail_image_width} Width (in pixels) of the Thumbnail Image.
{thumbnail_image_height} Height (in pixels) of the Thumbnail Image.
{screen_name} Screen Name of the author of this page.
{pub_day} Publication date: Day of the month (DD).
{pub_month} Publication date: Numeric Month (MM).
{pub_year} Publication date: Year (YYYY).
{mod_day} Last Modified date: Day of the month (DD).
{mod_month} Last Modified date: Numeric Month (MM).
{mod_year} Last Modified date: Year (YYYY).
{content} All content sections in sequential order.
{content[x]} Content section, number [x].
{user username} Username of user who made the page request.
{user informal} First name (if known) of the user who made the page request. Defaults to "User".
{user formal} First and Last name, or Initial and Last Name, or Title and Last Name (if known) of the user who made the page request. Defaults to "User".
{email name informal} First name (if known) of the email recipient. Defaults to "User".
{email name formal} First and Last name, or Initial and Last Name, or Title and Last Name (if known) of the email recipient. Defaults to "User".
{email} Email address of the email recipient.