CMS Maestro > Creating Custom Themes

Creating custom themes for the CMS Maestro is relatively simple. A theme is a collection of php files which dictate the style and layout of the site. Each theme requires the following files:

index.php: The file responsible declaring the general page layout.
Required php function calls:

  • <?php maestro_header()?> – renders the header
  • <?php maestro_main(); ?> – renders the main content
  • <?php maestro_footer(); ?> – renders the footer content

Optional function calls

  • <?php maestro_nav()?> – renders the main menu
  • <?php maestro_blocks(‘unique_block_id’); ?> – custom widget block, also declared in the theme.php file
  • <?php print $sets_sitedescription; ?> – prints the site description
  • <?php print $sets_sitename; ?> – prints the site name
  • <?php print $sets_sitekeywords; ?> – prints the sites keywords

node.php: Node specific file which determines the heading tag, page meta, and page content tags.
Required php function calls

  • <?php print $node_title ?> – content title
  • <?php print $node_content ?> – content
  • <?php print $node_meta ?> – content meta

nodes.php: Defines the style of a list of nodes, used mostly by listing content within a category.
Required php function calls

  • <?php print $node_title ?> – content title
  • <?php print $node_content.’ ‘.$node_more ?> – content teaser and read more link
  • <?php print $node_meta ?> – content meta

theme.php: The theme details, such as theme name, theme description and widget areas.
Required php values

  • $theme_name – Human readable theme name, eg ‘My Theme’ The system name fir the theme is determined by the folder name of the theme.
  • $theme_author – Theme author.
  • $theme_description – a brief theme description.
  • $theme_blocks – Custom theme block id’s (eg ‘sidebar,left,sidebar_right) note multiple values are comma seperated, with no spaces.

styles.css: The visual styles applied to the theme via this cascading style sheet.

Images Folder: To store the themes image files

Theming a specific page or content type

The CMS Maestro supports fine grained theming, allowing a particular page or content type to look a different way to the rest of the website’s theme

Customizing a single page: This process is similar to creating your themes index file The only difference is the naming convention of that file. For examples to have an arbitrary page use a custom style or theme you would create a file in your templates folder titled node-31.php where 31 is the node id of that specific content.

Customizing an entire content type: Similarly the website layout can also be customized as per a content type basis. Therefore to have a different layout for articles you would create a file titled type-articles.php which would contain the html markup and relevant php tags

PHP functions:

Note that there are manditory php tags required for these custom theme files, namely:

  • <?php maestro_header()?> – renders the header
  • <?php maestro_main(); ?> – renders the main content
  • <?php maestro_footer(); ?> – renders the footer content

There is additional optional tags that you may also make use of:

  • <?php maestro_nav()?> – renders the main menu
  • <?php maestro_blocks(‘unique_block_id’); ?> – custom widget block, also declared in the theme.php file
  • <?php print $sets_sitedescription; ?> – prints the site description
  • <?php print $sets_sitename; ?> – prints the site name
  • <?php print $sets_sitekeywords; ?> – prints the sites keywords