Creating a theme

Create the main folder for your theme at:

/application/design/yourtheme

Layout script

Copy the sample layout script to:

/application/design/yourtheme/layouts/scripts/layout.phtml

In CMS > System Configuration > Advanced > Website Theme, change the value to "yourtheme" and Save. Now refresh the front-end of the site to see a very basic site layout combined with the default view script for the homepage.

Overriding the default homepage view script

Copy the sample homepage view script to:

/application/design/yourtheme/views/scripts/index/index.phtml

Now refresh the front-end again and you'll see the default homepage has been replaced with the sample one. Notice that the index folder is used because the homepage is generated by the IndexController.

Overriding default page template view scripts

MetaScale comes with a few default scripts:

  • 1.phtml = Standard (No image, normally used for terms, privacy statements etc)
  • 2.phtml = Image on top
  • 3.phtml = Image on right
  • 4.phtml = Image on left
  • 5.phtml = Sub-page grid
  • 6.phtml = Contact Form

You will need to customise these for your project. For example, to override 4.phtml (Image on left), copy it to your theme folder:

/application/design/yourtheme/views/scripts/templates/4.phtml

Make a some cutomisation to it and refresh the page, you'll see the output from your custom view script.

Adding new templates (the role of config.xml)

You can add new templates by copying them to the same templates folder as above and declaring them in the config.xml file.

 

Related nodes
$nodes = $this->node->getCollection()->getRelated();