Template Functions

These functions can be used inside template.html to build your own custom templates:


Displays the content of CMSimple pages. This function is mostly used without parameters.

Accepted parameters:

  1. search results background:
    The background color of the text in the search results
  2. search results text:
    The text color in the search results

Example:

<?php echo content('#920','#fff');?>

Search results are shown in the text with dark red background color (#920) and white text color (#fff).

Without parameters, content() will show the search results with a yellow background color.

back to overview ⇑

Inserts the html header in CMSimple pages.

Accepted parameters: none

Example:

<!DOCTYPE html>
<head>
<?php echo head();?>
</head>
...

back to overview ⇑


Creates a link to the home page.

Accepted parameters:

  1. image: File name of the image or icon. The location of the image must be inside the template images folder.

Example:

<?php echo homelink('homelink.gif');?>

Without parameter, homelink() uses a language variable.

back to overview ⇑


Inserts a language selection with flags for your CMSimple pages. Useful only for multilingual websites.

Accepted parameters: none

Usage:

<?php echo languagemenu();?>

back to overview ⇑


Shows the date and time of the last page update (content.php).

Accepted parameters: none

Usage:

<?php echo lastupdate();?>

back to overview ⇑


Creates a breadcrumb navigation (path navigation). This function is mostly used without parameters.

Accepted parameters:

  1. delimiter: the separator character used between the path elements
    Standard character: >

Example:

<?php echo locator('&lt;');?>

Without parameter, locator() uses the > (greater than) as the separator character.

You also can use a picture or icon as a separator. In the following example, the location of the picture locator.png is located inside the template images folder.

<?php echo locator('<img src="' . $pth['folder']['templateimages'] . 'locator.png" alt="delimiter">');?>

back to overview ⇑


Creates a link to the login page.

Accepted parameters: none

Usage:

<?php echo loginlink();?>

back to overview ⇑


Creates a link to the CMSimple Mailform if an email address is entered in the CMS configuration.

Accepted parameters:

  1. image: File name of the image or icon. The location of the image must be inside the template images folder.

Example:

<?php echo mailformlink('mailformlink.gif');?>

Without parameter, mailformlink() uses a language variable.

back to overview ⇑


Displays the content of a CMSimple page. This function is often used to display latest news in a sidebar, as well for links to important pages, so actually for user behavior control.

Usually such news pages are hidden and not part of the website navigation menu.

Accepted parameters:

  1. pagename: Name of the page whose content is to be displayed. The page name must be written as it appears in the address bar of the browser.

Example:

<?php echo newsbox('News01');?>

Displays the content of the (hidden) page News01.

back to overview ⇑


Creates a link to the next page.

Accepted parameters:

  1. image: File name of the image or icon. The image location must be inside the template images folder.

Example:

<?php echo nextpage('next.gif');?>

Without parameter, nextpage() uses a language variable.

back to overview ⇑


As of CMSimple 4.6. this function is no longer necessary. However, it should still be used in the body tag for backwards compatibility. Otherwise the editor will not work in versions older than CMSimple 4.6.

Accepted parameters: none

Usage: in the body-tag

<body id="body" <?php echo onload();?>>

back to overview ⇑


Inserts the title of the current loaded CMSimple page.

Accepted parameters: none

Usage:

<?php echo pagename();?>

back to overview ⇑


Creates a link to the previous page.

Accepted parameters:

  1. image: File name of the image or icon. The location of the image must be inside the template images folder.

Example:

<?php echo previouspage('prev.gif');?>

Without parameter, previouspage() uses a language variable.

back to overview ⇑


Creates a link to the print preview.

Accepted parameters:

  1. image: File name of the image or icon. The location of the image must be inside the template images folder.

Example:

<?php echo printlink('printlink.gif');?>

Without parameter, printlink() uses a language variable.

back to overview ⇑


Creates a search bar for the CMSimple website search.

Accepted parameters: none

Usage:

<?php echo searchbox();?>

back to overview ⇑


Creates a link to the CMSimple website index (sitemap).

Accepted parameters:

  1. image: File name of the image or icon. The location of the image must be inside the template images folder.

Example:

<?php echo sitemaplink('sitemaplink.gif');?>

Without parameter, sitemaplink() uses a language variable.

back to overview ⇑


Inserts the title of the CMSimple website.

Accepted parameters: none

Usage: Mostly in the header of the page

back to overview ⇑

Generates a menu to the subpages of the current CMSimple page, if available.

Accepted parameters: none

Usage:

<?php echo submenu();?>

back to overview ⇑


Displays the CMSimple main menu (pages menu). This function is mostly used without parameters.

Accepted parameters:

  1. menulevel from: lowest displayed menu level
    default: 1
  2. menulevel up to: highest displayed menu level
    default: accordingly to the CMS configuration
  3. opentoc:
    0 => dynamic menu
    1 => open menu
    default: 0

Example:

<?php echo toc(1,2,1);?>

Displays the CMSimple pages menu from menu level 1 to menu level 2, as an open menu. Pages of menu level 3 and higher are not displayed.

Without parameters, toc() creates a dynamic menu across all menu levels.

back to overview ⇑


Creates a link to the beginning of a page or to an html element with id = "TOP".

Accepted parameters:

  1. image: File name of the image or icon. The location of the image must be inside the template images folder.

Example:

<?php echo top('top.gif');?>

Without parameter, top() uses a language variable.

back to overview ⇑