Developer guide     >     Developing Templates     >     Examples

Full Template

This is a ready-to-use example Template. You should download the Template source code and follow the instructions below in order to get it up and running.

Template configuration

Go to the Template administration panel and create a new Template by uploading the example html Template file.
Template configuration

Entry Mask configuration

Head over to the Entry Mask administration panel and create two Entry Masks: 
The CODE of the first Entry Mask needs to be set to ENTRYMASK1_IDENTIFIER. You need to add one Rich text form field of which the IDENTIFIER needs to be set to FIELD_IDENTIFIER (see screenshot below).
First Entry Mask
Add another Entry Mask. The CODE of the second Entry Mask needs to be set to ENTRYMASK2_IDENTIFIER. It needs to contain two form fields: One Single line text field of which the IDENTIFIER needs to be set to FIELD1_IDENTIFIER and one Link field of which the  IDENTIFIER needs to be set to FIELD2_IDENTIFIER (see screenshot below).
Second Entry Mask

Page setup

Go to the Page administration and create Pages. Make sure that you select the new Template on the Appearance tab of the Pages. You may also select it as the default Template in the Site administration, so new Pages of your Site get this Template assigned automatically.

The Template makes use of two navigations (menu_main and menu_footer). You can select the respective navigation on the Appearance tab of a Page to make it appear in either one of those. 
To add some content to your Pages assign either of the Entry Masks to the content area on the Pages' Content tabs.

Source code

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="utf-8">
  5.     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6.     <meta name="description" content="{$pageinfo.DESCRIPTION}">
  7.     {if $siteinfo.FAVICON_URL}<link rel="Shortcut Icon" href="{$siteinfo.FAVICON_URL}" type="image/x-icon" />{/if}
  8.     <title>{if $pageinfo.TITLE}{$pageinfo.TITLE}{else}{$pageinfo.NAME}{/if}</title>
  9. </head>
  10. <body>
  11.     <div id="cnt">
  12.         <div class="page">
  13.             <div class="nav">
  14.             <!-- navi: menu_main -->
  15.             {assign var="ntree" value=$tree|@nest_tree}
  16.             {definefunc name="render_menu" list=$ntree}
  17.                 <ul{if $element.SUBOPEN} class="open"{/if}>
  18.                     {foreach from=$list item=element}
  19.                         {if $element.NAVIGATIONCODE == "menu_main"}
  20.                         <li class="{if $element.SELECTED}selected{/if}{if $element.SUBOPEN} open{/if}">
  21.                             <a href="{$element.URL}">{$element.NAME}</a>
  22.                             {if $element.CHILDREN}{execfunc name="render_menu" list=$element.CHILDREN}{/if}
  23.                         </li>
  24.                         {/if}
  25.                     {/foreach}
  26.                 </ul>
  27.             {/definefunc}
  28.             </div>
  29.             <div class="content">
  30.                 <div class="sitename">{$siteinfo.NAME}</div>
  31.                 <h1>{if $pageinfo.TITLE}{$pageinfo.TITLE}{else}{$pageinfo.NAME}{/if}</h1>
  32.                 <!-- contentarea begin: CONTENTAREA_EXAMPLE -->
  33.                 <!-- contentarea accepts: ENTRYMASK1_IDENTIFIER, ENTRYMASK2_IDENTIFIER -->
  34.                 {foreach from=$contentareas.CONTENTAREA_EXAMPLE.CBLOCKS item=cbs}
  35.                     {foreach from=$cbs.ENTRYMASKS item=entrymask}
  37.                         {if $entrymask.CODE == "ENTRYMASK1_IDENTIFIER"}
  38.                             {$entrymask.FORMFIELDS.FIELD_IDENTIFIER.VALUE}
  39.                         {/if}
  41.                         {if $entrymask.CODE == "ENTRYMASK2_IDENTIFIER"}
  42.                             <br><br><a href="{$entrymask.FORMFIELDS.FIELD2_IDENTIFIER.URL}">{$entrymask.FORMFIELDS.FIELD1_IDENTIFIER.VALUE}</a>
  43.                         {/if}
  45.                     {/foreach}
  46.                 {/foreach}
  47.                 <!-- contentarea end: CONTENTAREA_EXAMPLE -->
  48.             </div>
  49.             <div style="clear:both"></div>
  50.         </div>
  51.         <div class="footer">
  52.         <!-- navi: menu_footer -->
  53.         Footer navigation:  
  54.         {foreach from=$tree item=element}
  55.         {if ($element.NAVIGATIONCODE == "menu_footer")}
  56.             <a href="{$element.URL}"{if $element.SELECTED} class="selected"{/if}>{$element.NAME}</a>  
  57.         {/if}
  58.         {/foreach}
  59.         </div>
  60.     </div>
  61. </body>
  62. </html>