Templates contain the HTML mark-up, any referenced CSS & JS files and special fields which SiempreCMS uses to replace with content.

Templates Overview

If you click on the Templates page.

In the Standard Tab there are number of fields and some buttons:

  • Template ID – internal ID used by SiempreCMS
  • Template Name – a name
  • Created – who created the template
  • Last Updated – when the template was last updated
  • Description – an internal description to aid users in which template to use – (editable)
  • Content – the HTML and SiempreCMS Template mark-up – (editable)
  • Add standard SEO META fields? – Clicking this button adds some standard SEO Meta fields. See 5.9.1 - Add standard SEO META fields
  • Add SEO Fields – Clicking this button adds some standard SEO Meta fields. See 5.9.2 - Add SEO Fields

Parent Templates

You can either put the full template content in each page template or you can inherit the common “frame” of the HTML (and all references) from the Site Settings node.

Setting up the Parent Template

See section 3.3.1 - Creating the Master Template for full details but the key point is to add the tag:


Then ensure each child template has the Use Site Template as Parent checkbox set.


Use Site Template as Parent checkbox


Simple field tags

Tags can be placed anywhere in the parent and child templates. Fields are denoted by the opening and closing tags {| |}.  The Page denotes that the content should come from the page.



Some points to note:

  • Fields are case sensitive
  • The field tags should *not* have spaces between them
  • The field tags are configurable but it is not recommended that you change them in the current version of the CMS until the code base has stabilised.

Page, Site or PageOrSite Field Tag Prefixes

Tags may be prefixed with wither Page, Site or PageOrSite.

  • Page – comes from the page itself. No recursion.
  • Site – content comes from the website root node (useful for default text, site footers etc.).
  • PageOrSite – SiempreCMS tries to get the content from the Page first if it’s set, if not the Site content is used. This can be useful to provide default values.

Special Field Tags

The following snippet shows the special field tags used by SiempreCMS which are available to use in all templates – the content data is provided by default on each node and fields should not be created with these names.

<li>Create date: {|Page.createdDate|}</li>

<li>createdBy: {|Page.createdBy|}</li>

<li>createdByID: {|Page.createdByID|}</li>

<li>lastUpdated: {|Page.lastUpdatedDate|}</li>

<li>lastUpdatedBy: {|Page.lastUpdatedBy|}</li>

<li>lastUpdatedByID: {|Page.lastUpdatedByID|}</li>

<li>Page URL: {|Page.URL|}</li>

<li>Node Name: {|Page.nodeName|}</li>



// only used in children (e.g. Child is part of a loop

<a href="{|Child.URL|}">Some link</a>

<li>sortOrder: {| Child.sortOrder|}</li>

Conditional Statements

If and If Else

IF statements must start with @if(conditional). You can use page fields within the conditional output if you like. IF statements are followed by two special fields {|if|} and {|/if} this tells SiempreCMS the block of content that is only output if the conditional statement is true. You can also have an else block using {|else|} {|/else|}.  There is currently no ifelse structure.

{|@if( {|Page.ifVar|} == 4)





           <h4>Otherwise: {|Page.pageTitle|}</h4>




NOTE: You can chain conditionals using && and || (these are AND and OR) but you MUST surround each logical statement in brackets e.g.

          {|@if (({|Page.TextField1|} == "testfdsf") && ({|Page.TextField2|} == "test") )  WORKS

          {|@if ({|Page.TextField1|} == "testfdsf" && {|Page.TextField2|} == "test" ) DOES NOT WORK

NOTE – if you’re conditional statement appears not to work ensure you have a {|if|} and {|/if} tags around the if true block.

Parent Child Node structures

This area of the CMS is not yet fully feature complete but the intention is to all you to create a child nodes under a “container” node that will allow for functionality of listing child nodes whilst having those as separate pages.

A simple example would be a News “Container” which shows previews of the latest news articles (“children” under the news container).


Setting up

It’s important that if you’ve already created the News Container and some news items and then add the template code to list the children you go and save and publish each of the children. This is a bug that might be fixed in a future version.

Template code

{|@foreach(item in @Page.Children.SortBy("lastUpdated DESC"))











Forthcoming Features

Currently you can only list a simple list of the children. Forthcoming features are:

  • OrderBy / SortBy – ability to specify a data value to sort on ascending or descending
  • OrderBy / SortBy – multiple data values specified
  • Where – Filtering on data values (e.g. where month = January)
  • Take(X) – Get the top x number of child nodes
  • First – get the first one
  • AJAX support. To power a complex news filter for example.


Checking Current Page

For navigation active / current highlighting you can do something like this:


<ul class="test">

{|@if( {|Page.URL|} == "")


           <li><a href="/" class="current">Home</a></li>



           <li><a href="/">Home</a></li>



{|@if( {|Page.URL|} == "events")


           <li><a href="/events" class="current">Events</a></li>



           <li><a href="/events">Events</a></li>



{|@if( {|Page.URL|} == "news")  


           <li><a href="/news" class="current">News</a></li>



           <li><a href="/news">News</a></li>




Adding SEO Fields

Add standard SEO META fields

Clicking the Add standard SEO META fields button will add some inbuilt fields. You still need to add these to your template markup for them to be output and useful.

  • PageTitle - Page title is shown in the browser title, you might make this your h1
  • MetaDescription - For SEO it is best to keep meta descriptions between 150 and 160
  • MetaTags - Meta tags are a bit old hat and ignored by Google but here by popular demand
  • NoIndex - Asks Google / Bing et al not to add this page to the index

Add SEO Fields

Clicking the Add SEO Fields button adds some standard SEO Meta fields. You still need to add these to your template markup for them to be output and useful

  • SitemapChangeFreq - Used in the sitemap for SEO purposes. You can leave this blank, set to Never for archived pages.  Valid options: always, hourly, daily, weekly, monthly, yearly, never
  • SitemapPriority - Set a number between 1 - 10 (output is divided by 10) default is 5 (0.5)
  • SitemapHide - Hide from sitemap?

Next:- Modules