How to write new Designs

This article covers the first steps in creating a new Template & Design for your website. Follow the instructions in the given order and you will have a usable (no, not pretty: usable!) design afterwards.

Start with logging in and switching to Administration -> Layout.


Open "Stylesheet" and create a new Stylesheet by passing:

  • the name "ExampleCSS"

  • an optional description "Stylesheet for education"

  • the Editor Stylesheet "dummy_stylesheet" for the beginning

Hit the create icon and post the following code into the editor:

body { background-color: #7bb000; font-family: Verdana, Geneva, Arial; }
h1 { font-size:16px; font-weight:bold; border-bottom:2px dotted orange; width:650px; padding-left:10px; }
#content { font-size:12px; width:640px; padding-left:20px; color: #000000; border-bottom:2px dotted orange; }
#navigation li { display:inline; }
#navigation a { font-size:12px; color:#ffffff; font-weight:bold; }
#content {}
#logo {}
#header {}
#footer  {}

Now save it and change the Administration to "Templates".

Smarty Template

Create a new Template by passing:

  • the name "Example-Template"

  • an optional description "Template for educational work"

  • check the Template radio button (switch from include to template)

Hit the create icon to open the new templates detail page.

Add following content into the template editor:

`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">`
`<html xmlns="" xml:lang="{$MENU->`getLanguageID()}" lang="{$MENU->getLanguageID()}">
{load_item id="-1" itemtype="1" assign="topLevel"}
    `<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />`
   `<link rel="stylesheet" href="{stylesheet name="ExampleCSS"}" type="text/css" media="screen, projection" >`
   {metatags item=$MENU}
   `<div id="header">` 
       `<span id="logo">``<a href="{link item=$topLevel}">`{sitename|htmlspecialchars}`</a>``</span>`
       `<ul id="navigation">`
           {navigation prefix="`<li>`" suffix="`</li>`" counter="amount"}

   `<div id="content">`
       {modul menu=$MENU}

   `<div id="footer">`
   {if $USER->isAnonymous()}
      `<a href="{link_login id=$MENU->`getID()}">{translate key="login"}`</a>`
      {permission_editcontent assign='allowEditor'}
      {if $allowEditor}
         `<a target="_blank" href="{link_editor id=$MENU->`getID() language=$MENU->getLanguageID()}">Edit page`</a>` |
      `<a target="_blank" href="{link_admin}">`Administration`</a>` | 
      `<a href="{link_logout id=$MENU->`getID()}">Logout`</a>`

Before saving the Template check the radio button Template ready (choosable for new Designs).

For a "real world" template you might need a lot more Smarty TAGs.

Last point is to create a design, which then can be assigned to menus. Change to Administration: "Page Design".


Create a new Design by passing:

  • the name "Example-Design"

  • an optional description "Design for educational work"

  • the previous created stylesheet "ExampleCSS"

  • and the template "Example-Template"

After creation, using the create icon, change to the menu administration.

Assign the new Design

Open the Menu Administration and edit the Top Level Page. Assign the Layout Example-Design and save the page. Now hit the Preview Button and the menu will be displayed ... in green, orange and black and white LOL.

Thats all, should be done in 20 minutes even without experience. Have fun and post your experience about this article in the Forum or improve it, if you find any mistake!

Please read the page bigace:developer:smarty carefully and check out the default template skeleton.