Making your own Theme using Multiple Layouts


Revision as of 15:13, 16 November 2010 by Dinsley (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In some cases, you may require multiple layouts for your custom theme. When would this be applicable? An example would be to facilitate a splash page or a special home page. The best way to do this would be to have a separate layout in your theme, and then simply select that layout for your front page.

When available, our included website themes will have additional layouts. If so, you can use these with your pages in the Page Settings for an existing page, or in the process of creating a new page. You can edit the code for these layouts in the Edit Theme Source Code section of the Toolbar. The naming convention for these files is easy to understand - it uses the name of the file as the name of the layout (single_column shows up as 'Single column') for example.

We'll use an example below which will assume you want to create a separate layout for a splash page.

Creating Layouts

Creating another layout is pretty simple. When you unzip a theme into a directory you should have a default.html file which is your theme file. As mentioned above, there may be other available layouts for this theme and one of these may be more applicable for your custom layout. Simply make a copy of the file and rename it to whatever you want to call your custom layout. Note that the file must remain an html file, so to create a 'Splash' layout, the filename should be "splash.html".

Make whatever changes you want to your layout following the regular theming guidelines found in the Making your own Theme area.

Applying Your Changes

When ready, just upload your custom theme. The Page Settings (either when creating a new page, or editing an existing one) will include a new section called "Layout" where you can select your custom "Splash" layout.