iWebPress iWebPress: User Guide

5.2. Template Design Guide

As discussed in the Templates section of the documentation - a prerequisite for this chapter - templates are simply normal HTML or XML pages with IML variables in the place of actual content. There are three different types of templates, namely mail, print, and web templates, but in this chapter we concern ourselves solely with web templates. As a rule, just as one HTML file outputs one webpage, one template also outputs one webpage. So, in the case of your website, templates are bundled together in packages referred to as themes so there is a different template to render a section than to render a user.

In the Template File System chapter, we learned that web templates are arranged in a virtual file-structure:

We also learned that the template engine 'knows' what template to grab and goes from the most specific applicable template to the least specific applicable template. Now, we will learn more about each type of template in a theme (i.e. archiveTemplate, assignmentTemplate) and what they can be used for:

Template: Description: Available variables: Override per-issue: Override per-item:
archiveTemplate Displays a list of old issues in ascending date order
  • %page% - the auto-generated issues table is currently not customizable; place %page% where you would like this element to appear
  • General variables (i.e. %paperName%)
No No
assignmentsTemplate Renders a single article or image assignment (and possibly associated children) Yes Yes
imagesTemplate Outputs all children which are images and are referenced by a parent assignment Yes No
printTemplate Renders a single article or image assignment (and possibly associated children) in a printer-friendly, style-list format Yes No
rssTemplate Essentially a section page but in XML format for syndication Yes No
searchTemplate Displays the results of a user's search
  • %page% - the search box and results are currently not customizable; place %page% where you would like this element to appear
  • General variables (i.e. %paperName%)
No No
sectionsTemplate Determines the appearance of every section of the paper as well as your homepage (essentially the highest ranked section in your paper) Yes Yes
usersTemplate Displays the appearance of user profiles No No

Creating a new theme then, is as easy as creating a new directory in webroot/themes (you can access the template virtual file structure by clicking on Templates in the menu, if you have an access level of at least Editor-in-Chief) with the name of your new theme. In that new directory, simply click Add template to create the eight different templates and name them appropriately (they are case-sensitive). You can then upload your own files that you designed in Dreamweaver or GoLive, or use iWebPress's build-in WYSIWYG editor to create templates. Keep in mind that you can only use variables that are "available" for that template (see the chart above). See the iWebPress Markup Language section for more information about designing your pages with IML variables and functions. Looking at the included templates will also probably be beneficial.

You can also override the theme in iWebPress, if so indicated in the above chart. Overriding per-issue means that applying a different theme in Step 1 in the Issue Publication Panel (see the Web Publishing Panel) will cause the page to look like that newly applied theme. Overriding per-item involves customizing the appearance in Step 2 in the Issue Publication Panel. You can customize the appearance of a section, all the assignments in a section, or a single section.