iWebPress iWebPress: User Guide

4. Templates

In the simplest sense, templates are a definition for rendering content. They are normal HTML or XML pages and can be created by anyone with a knack for design. There is, however, one important difference: instead of inserting content, such as an actual title/headline, designers include certain keywords as markers to tell the template engine where to put data. So, instead of typing, for example, "Winner in Iran Calls for Unity; Reformists Reel" where the headline should appear, the template author would put %assignmentTitle%. You can upload your own files that you designed in Dreamweaver or GoLive, or use iWebPress's build-in WYSIWYG editor to create templates.

iWebPress' template engine is specifically designed with web designers in mind. Our engine requires little to no programming knowledge, and allows you to work almost exclusively in a WYSIWYG editor. However, some of the concepts of this section require some basic web development knowledge. When in doubt, check the example template included with iWebPress. Source files for our templates are available upon request, and can often jump start your development.

There are three different types of templates: mail, print,and web. Mail templates are e-mailed to users and can be used for such things as mass-sending contributors a list of their assignments and the due dates so they are aware of what work they must complete (See E-mailing users). Print templates can be used for similar functions but in a paper environment (so, instead of e-mailing, they can be delivered to a recipient's physical inbox). They can also be used for various organizational purposes or in case you don't like the 'default' print formatting. Finally, web templates control all aspects of the appearance of your publication's website.

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. This is because you probably want to use a different template to render a section than you would to render a user. No interaction on your end is required, because when a user visits your website, the template engine 'knows' to grab assignmentTemplate when an article (or image) is requested and sectionTemplate when the visitor goes to a section page. Mail and print templates tend not have the same kind relationship and are generally single, independent files.



4.1. Template File System
4.2. iWebPress Markup Language
4.2.1. Static Keywords
4.2.2. Introduction to Lists
4.2.3. Simple Lists
4.2.4. Dynamic Lists
4.2.5. Functions
4.3. Short Template Examples
4.3.1. Simple Lists
4.3.2. Dynamic Lists
4.3.3. ... With Two Elements
4.3.4. ... With Several Columns
4.3.5. ... With Multiple Elements & Columns
4.4. Available Variables
4.4.1. Section Variables
4.4.2. Assignment Variables
4.4.3. Other useful variables
4.4.4. User variables
4.4.5. User's Assignment variables