Getting started

What is the difference between a skin and a template?

Scenario:
"I've just installed Nucleus and it all looks great but I'm really confused by this skin and template thing."

Explanation:
Nucleus uses a skins and templates system to control the look of Nucleus websites. The system is divided into 2 parts:

  1. skin
  2. templates

When you put a skin and its templates together, you get an entire design. Usually a skin will have more than one template that belongs with it. Let's investigate how this works with the typical blog site. A typical blog has a header section with the blog name and a picture, a navigation bar, a content section where posts are displayed and a footer section with the copyright information. Here's a rough summary:

Site ComponentSkinTemplate
Page header with site name and logoX 
Navigation barX 
Content areaPosition onlyX
Footer with copyright informationX 

Areas controlled by skin and template.

Here, the section is red is controlled by the template and the blue is controlled by the skin. Where the red outlined section is located on the screen is also controlled by the skin.

Skin:
The skin controls how all the elements of the page look, including where the content area is positioned on the page. A skin has 8 different parts to it to tell Nucleus how to display different pages.

Skin partFunction
Main IndexThe home page of your Nucleus site.
Item PagesPage displaying the full text of one item and its comments only.
Archive ListDisplays a list of all your items grouped by months (default). The list formatting is controlled by a template.
ArchiveSimilar to the Main Index, but displays all the items for a given month (default).
Member DetailsDisplays information about a particular member, such as their real name, web site address, an email contact form and any other short notes the member would like to be displayed.
SearchSimilar to the Main Index, but displays all the items returned for a search query.
ErrorsDisplays an error message when something has gone wrong.
Image PopupsControls the look of the popup window for images which display in a popup window.

Template:
Templates control how the items themselves should look. Items can usually be divided into 4 sections for easy maintenance.

  1. item header - usually contains the title of the post and other information about the post (date, time, author and category in our default skin example - see below)
  2. item body - the actual text of the post
  3. item footer - can contain information about the post if it was not included in the item header, may also contain the "Read more" link to the full item text
  4. comments area - displays all the comments made on the post and the comment form

A closer look at the template.

In addition to controlling the display of items, templates also control

  1. how the list of archives look in the Archive List skin part;
  2. how the list of categories looks in the navigation bar;
  3. parts of the search query; and
  4. how dates and times are displayed (locale settings)

Further reading:

Why not try some experimentation on the live Nucleus demo site?

section: Getting started | submitted by Leng on 2005.Oct.15 | 7756 views

item rate
Total votes: 21 - Rating: 8.19

Please tell us how useful this answer was to you (0 = useless, 10 = very very helpful):

10