The Template System
An Escenic template set is a set of JSP files that:
-
Have access to a number of beans representing Escenic objects such as articles and sections
-
Have access to a number of Escenic tag libraries providing functionality that cannot easily be achieved using the available beans, JSP expressions and standard JSTL tags
You can organize these JSP files anyway you like. The only requirement is
that there is a single "master template" - one JSP file that is called by
the
Content Engine
in response to every user request. Normally this file must be called
common.jsp
, and located in the
publication/WEB-INF/template
folder. It is possible to change this default name and location (see
The
default.properties File), but should not normally be necessary.
In theory you could implement the whole template system in
common.jsp
, but normal practice is to break the system
down into a number of smaller, simpler files. The
temp-dev
application templates described in this
section are broken down in this way. The structure of this template set
is, however, just an example: precisely how you organize your templates is
up to you.
CSS usage
You will notice that the template examples listed in the following
sections contain no CSS or other HTML formatting
information. Many elements, on the other hand, are enclosed in HTML
div
elements with class
or
id
attributes. The common.jsp
template contains a reference to a CSS file which contains all formatting
instructions required to render the pages. The
class
/id
attributes in the final
HTML output are used by the browser to look up the appropriate styles in
the referenced CSS file.
In this way, the templates deal only with content and structure, and all layout issues are dealt with in the CSS file. It is possible to completely change the appearance of a site by simply changing the CSS file that is used.