iStrip themes

[ Back to top ]

Preamble
This document aims to cover the basics of installing and using iStrip themes. For more details on editing and creating the template files that make up themes, see the documentation on template building and template variables

[ Back to top ]

Old templates
For the purpose of the following discussion, all versions of iStrip prior to 1.2.0 are considered old.

Old versions of iStrip utilized a basic template engine that did simple variable substitutions. From version 1.2.0 the Smarty code library is utilized to provide templates instead. This engine uses a syntax that is not compatible with the old template system. Furthermore, the names used for template variables are significantly different in order to organize them more sensibly. For these reasons you cannot use old templates with versions of iStrip that use Smarty.

The old template system did not support looping, optional sections or default values. In order to achieve some looping functionality old versions of iStrip had some internal functions that would apply sub-templates to certain items of data and generate a simple template variable for use in the main template. This is no longer necessary as Smarty can do loops and conditionals in situ and so these sub-templates are now obsolete.

The new format for variables and for loops and conditional blocks is described in the template building documentation. The changes in template variable name are listed in full in the template variable documentation, along with a list of depreciated variables. Consult these documents for information on how to rework your existing templates

[ Back to top ]

Constructing themes
A theme is a directory of template files and their associated data, for example image files, CSS stylesheets, etc. A theme, at the very least, must contain an index.tpl file for displaying the main page of your site. The index.tpl file is the template iStrip will use by default to generate your comic site home page. If a visitor tries to load a template that isn't available then index.tpl will be loaded instead. The name that iStrip will use for a theme is the name of the directory is stored in.

In addition to the index.tpl file, the theme may also contain other templates for other pages, for example it may contain a characters.tpl file for a characters page, archive.tpl for a page that lists all the strips you have thus far posted, or any other page you would like to include on your site. These templates are allalso processed by the index.pho script and therefore all have the same template options available to them. See the documentation on template building and on template variables for more details on what features are available in template files used in your themes.

If you intend to makes use of the component library then a theme may also have a subdirectory for the components that it uses. It is important that components are not stored in the root of the theme directory as it may make them available for visitors to view them directly, which could have unpredictable results. In fact, it is recommended that only the actual templates are kept in the root directory and that all other file types, such as components and images are stored in subdirectories. For more details on the component library see the template toolkit documentation.

[ Back to top ]

Installing themes
A theme is a directory, containing at the very least an index.tpl file. It may also contain some other tpl files for other pages, stylesheets, scripts, images, etc. These directories are stored in the iStrip template folder (smarty_templates by default). To install a new theme, use the following procedure:
  1. Verify that the necessary files are present in the theme directory
  2. Upload the theme directory and it's contents to the template directory on your server. Do not place the template files directly in the template directory, they need to be in a theme directory under the template directory. iStrip expects the templates directory to contain other directories and a new theme will not be installable if it is not installed in it's own directory
  3. Use your browser to load the iStrip configuration page on your server. Under the template section is a drop box with a list of installed themes. By default there are 2 themes already installed, minimalist and demo. Your installed themes will also appear in this drop box. Use the drop box to pick the theme you wish to use from the list and save changes
When you change themes iStrip will automatically flush out the template compile directory and the next time someone visits your comic page iStrip will recompile the templates from the new theme.

[ Back to top ]

Supplied themes
There are 2 themes provided with iStrip, demo (the default theme) and minimalist. The demo theme is designed to show off some of the features of iStrip and of the Smarty template engine while minimalist provides a basic page layout for getting your comic up and running. Neither theme was designed with use on a real live comic site in mind, though the minimalist theme will give you the basics for getting a comic up and running and has the advantage of being very low bandwidth. It is intended that you look at the source for the files supplied in these themes to get ideas on how to create your own.

Once you have created your own theme, installed it and set iStrip to use it you no longer need theme themes installed and you are free to delete them from the templates directory if you need more space on your server However, the space both themes together takes up is only about 40K so there probably isn't much to gain by doing this.

[ Back to top ]

Copyright © 2002, 2003 Gordon McVey