demo
templates
install
contact
Home Templates Creating

Creating templates

The templates in Contentor are very close to regular .HTML files. All of the standard web page development tools can be used to perform the initial layout. The system relies heavily on cascading style sheets for the look and feel. See the list of classes used for more details.

Contentor inserts a "base href" tag in the head of the template, so all links and images should be "site-root relative". If you plan to leave your template in the root folder of your site, then the links and images should work fine.

To place your template onto your site, use your web editor's FTP prorgam or you can use the direct install utility to place files from your hard drive onto your site.

PHP tags make it a template

Once the template page layout is completed, the insertion of several PHP tags completes the conversion to a Contentor template. The result is a template page that can be edited to incorporate later changes for the entire site.

Here's a quick list of the tags:

<?php echo "$page_head"; ?>

Placed in the page <head>, sets the page <base> and <title>
(note that as of version .954, the "<title><?php echo "$page_title"; ?></title>" is included in $page_head)

<?php
	$menuStyle = 'Vh';
	$menuSpacer = ' ';
	$menuSeparator = '';
	include "template/DefaultMenu.php";
?>

Points to the menu script for inclusion. The use of $_SERVER[DOCUMENT_ROOT] allows the template to be sharerd if multiple copies of the system are installed in various folders. See Menu Generator for details.

<?php echo "$content"; ?>

This is the main content of the page, sans side bars.

<?php echo "$sidebar"; ?>

Page sections that have the 'sidebar' box checked on the edit screen. This tag is usually placed in a collasping table cell so it takes up no space if not used.

<a href="<?php echo "$edit_path"; ?>">Edit Link Image, etc.</a>

To create a link to the edit mode. This is optional, as the edit maode can be entered by editing the URL address line to replace 'index' with 'edit'


More optional tags:

<?php echo "$breadcrumbs"; ?>

  Creates 'breadcrumb' navigation bar, such as:
Home / Templates / Creating /

The separator character is set in the system configuration _breadcrumb_divider setting. 'Home' always points to the root of the web server, which is useful for multiple copies of Contentor on a given site. To insert your own or to omit the 'Home' link, use '<?php echo "$pathlinks"; ?>' instead of 'breadcrumbs'.

If a 'count' table is specified in the system configuration, you may use the following tags:

<?php echo "$page_views"; ?>
<?php echo "$last_visit"; ?>
<?php echo "$last_edit"; ?>

  PHP functions can be included to format the $last_visit and $last_edit time/date display.


Note that PHP requires double quotes around strings if there are variables that need to be processed (i.e. "$_SERVER..".).
Single quotes (apostrophes) work best around literal strings of text that do not contain apostrophes.
Each line of PHP code must end with a semi-colon (;).