FacebookTwitterGoogle+Share

Themes and Skins

When planning the system that I am currently working on, I had two main goals. The latter being that I wanted to be able to easily and profoundly change the way it was displayed. The former is unrelated to this blok.

To do this, I made use of a combination of themes and skins, although these are probably poorly chosen names (it was late).

A Theme defines the HTML used. It can also include it’s own CSS files and images as appropriate. Basically, you can do everything that you can do with a skin with themes. A theme has several required files, and a few special files, but can can contain anything in addition to those.
The special files in a theme are files that override the default HTML that a module uses. They take the form of [module_name]-[file_name]. For example, to override the file product.html in the products module, you need only add a file named products-product.html to your theme directory.

A skin is basically the CSS that is automagically included in theme. They also have required files, special files, and can contain additional files. The required files are ones like style.css (the main style sheet for the skin) and screenshot.jpg (which is displayed to help the user pick a skin).
Special skin files are browser specific CSS files, files that will be included with conditional comments if they exist, and files that will be included by PHP according to the browser data apache gives it. This is to allow skins to work in most browsers with some level of ease.
The skin directory is a good place to include an images directory (as css files reference images relative to their location).

Both themes and skins make use of data holders. Data holders are character sequences that mark where in the HTML or CSS file data should be inserted. They take the form: <!–#data_name–>.

So, that was my method for allowing me to easily change the way the data is displayed. It seems to work pretty well so far, but I have only made one theme and one skin as yet :P.

 

Comments

  1. BRADLEY GILL says:

    BRADLEY GILL

    NO MATTER WHERE YOU HIDE

    NO MATTER WHERE YOU RUN

    I WILL FIND YOU

    BRADLEY GILL

    I WILL FIND YOU

    AND WHERE I FIND YOU

    I WILL FIND YOUR SOUL

You must be logged in to post a comment.