CMS » Documentation » Page/Document Structure

Page/Document Structure

All site owners try to separate the contents and the design of the page. They also try to make use of templates in order they can change the design of similar pages with one actual change of the code. The templating system in CMS uses the following page structure:


Header is the first html code sent to the browser. Header is common for all pages, and it should contain the beginning html tags, css definition, title definition, etc. If you wisht to put all your pages in a table of specific width, this is a good place to do it.
To make the creation of documents easy, CMS offers several variables that return page-specific text/information for your header. These are:
$title - Makes the use of titles for your pages automatic - returns Document title of each document set in Document Editor
$meta_keywords - Returns value of the Keywords field set in Document Editor
$meta_description - Returns value of the Document Description field set in Document Editor
You can also use other variables available for documents and templates:

$language - Returns language of the current page
$page - Returns name of the current page (not title)
$path - Returns path to the page (so called breadcrumb, which is computed from the parent settings of documents)
$forum - If this keywords is used on a page, it immediately becomes a forum document with all forum functions
$comments - This keyword creates a section similar to one topic in a forum, where users can create comments for the page
$allforums - This keyword displays a list of pages which are marked by 'Show in forum list' and contain $forum inside
$loginlogout - Displays login information if the user is logged on, or login form (plus more) if he is not logged on
$flags - Displays flags - links to those language versions of the page, which are filled
$lastmodified - Displays the date of the last modification of the page
$color1 - Returns value of the color defined in configuration file
$color2 - Returns value of the color defined in configuration file

Example of an header

<title> CMS: $title</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<meta name="keywords" content=", content management system, cms, web cms, $meta_keywords">
<meta name="description" content=" - Content Management System, $meta_description">
<link rel="stylesheet" href="css_ie.css">
<body bgcolor="#CCFFFF" topMargin=0 marginwidth="0" marginheight="0">

Template with text areas

Template is code that comes between the header and footer and contains the text areas of the actual document content. The text areas for user templates are marked by $text1, $text1, etc. variables. The maximum number of the text fields depends on the configuration (the current minimum and maximum is 10). You can use all other special variables in user templates as described in Header section of this page.

Example of an user template with two text areas:

<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
 <td valign="top" width="120">
 <td width="5" align="left" valign="top"> </td>
 <td align="left" valign="top">
<span class=c_normb>$path</span><br>

Note: The template might be empty (containing just e.g. $text1), and all the page code might be in header and footer. Alternatively your header and footer might be empty and all the page code might be in a user template. However good balance of the document structure saves site maintenance time.


Footer is the last part of code sent to the browser with all pages. It is useful for closing tags, or code with external statistics. Here is an example:

<br clear=all>
<table width="600" border="0" cellspacing="1" cellpadding="0" align="center" background="">
 <td align="center" >
  <span class=male><a href="index.php?lang=$language" target="_top">about</a> |
<a href="index.php?lang=$language&page=documentation" target="_top">documentation</a> | <a href="index.php?lang=$language&page=forum" target="_top">forums</a>
<font color="darkblue"> ©2003<br>$lastmodified</font>




about | documentation ©2003
Document was last modified on 30. 7. 2003