Using existing Template Two
Assumption:
To use the template Template Two the module org.opencms.frontend.templatetwo has to be installed.
There are following Template Two resource types:
- Template Two Article
- Template Two News
- Template Two Item
- Template Two Event
- Template Two Style
- Template Two Search Page
- Template Two Options
- Template Two Preset
- Template Two Linkbox
- Template Two Configuration
- Template Two Textbox
- Template Two Listbox
These resource types are to create in the OpenCms Explorer View with the New button and the choose from Template Two. In the following the handling of these resource types is described.
Template Two resource types
In this chapter the Template Two resource types are described.
Template Two Article
Following elements belong to a template two article:
- Title
- Content Paragraph
For this resource type it is possible to configure one of the following two layout types:
- Three column layout (Column left+right)
- Two column layout (Column left), this is the default layout
It is possible to arrange boxes, for example Template two textboxes. Therefore, in the "Configuration" node in the xml content can be created elements. Per element following attributes are to choose:
- a box in the VFS, for example a Template two textbox
- the orientation for the box (right, center, left), if there is used the two column layout only the left and center orientations shall be used
- a color schema for the box, here can be choosed between three different color schemas, these color schemas are defined in the Template Two style
Template Two News
A template two news contains the following elements:
- Date
- Title
- Subtitle
- Teaser
- Content Paragraph
- Author
- Author EMail
- Availability
Template Two Item
A template two item contains the following elements:
- Name
- Category
- Short Description
- Long Decsription
- Images
- Links
For this resource type it is possible to configure one of the following two layout types:
- Three column layout (Column left+right)
- Two column layout (Column left), this is the default layout
It is possible to arrange boxes, for example Template two textboxes. Therefore, in the "Configuration" node in the xml content can be created elements. Per element following attributes are to choose:
- a box in the VFS, for example a Template two textbox
- the orientation for the box (right, center, left), if there is used the two column layout only the left and center orientations shall be used
- a color schema for the box, here can be choosed between three different color schemas, these color schemas are defined in the Template Two style
Template Two Event
A template two event contains the following elements:
- Title
- Teaser
- Content Paragraph
- Date
- Availability
For this resource type it is possible to configure one of the following two layout types:
- Three column layout (Column left+right)
- Two column layout (Column left), this is the default layout
It is possible to arrange boxes, for example Template two textboxes. Therefore, in the "Configuration" node in the xml content can be created elements. Per element following attributes are to choose:
- a box in the VFS, for example a Template two textbox
- the orientation for the box (right, center, left), if there is used the two column layout only the left and center orientations shall be used
- a color schema for the box, here can be choosed between three different color schemas, these color schemas are defined in the Template Two style
Template Two Style
A template two style contains following elements:
- Inner Window - Width
- Window - Background Color
- Window - Background Image
- Inner Page - Background Color
- Font Color
- Inner Page - Padding
- Header - Font Color
- Header - Background Color
- Header - Background Image
- Breadcrumb - Divider
- Footer - Font Color
- Footer - Background Color
- Footer - Background Image
- Footer - Divider
- Font Family
- Link Color
- Link Hover Color
- Left Column - Divider
- Right Column - Divider
- Box Style 1 - Background Color
- Box Style 1 - Header Background Color
- Box Style 1 - Header Font Color
- Box Style 2 - Background Color
- Box Style 2 - Header Background Color
- Box Style 2 - Header Font Color
- Box Style 3 - Background Color
- Box Style 3 - Header Background Color
- Box Style 3 - Header Font Color
- Main Menu
- Main Menu - Background Color
- Main Menu - Font Color
- Main Menu - Background Hover Color
- Main Menu - Font Hover Color
- Main Menu - Background Active Color
- Main Menu - Font Active Color
- Left Navigation - Background Hover Color
- Left Navigation - Font Hover Color
- Left Navigation - Background Active Color
- Left Navigation - Font Active Color
- Additional CSS File
To use the Template Two Style file on a resource, on the property 'style.layout' on this resource the site path to the Template Two Style resource is to set.
Template Two Search Page
A template two style contains following elements:
- Text
- No Result text
- Error Text
Template Two Options
A template two options contains following elements:
- Top Navigation
- Header
- Footer
To use the Template Two Options file on a resource, on the property 'style.options' on this resource the site path to the Template Two Options resource is to set.
Template Two Preset
A template two preset consists of following elements:
- Left Column - Visibility
- Left Column - Width
- Right Column - Visibility
- Right Column - Width
- Left Navigation - Visibility
Template Two Linkbox
A template two linkbox consists of following elements:
- Title
- Description
- Links
Template Two Configuration
A template two configuration consists of following elements:
- Preset
- Element
Template Two Textbox
A Template Two Textbox can show static text. Therefore, a Template Two Textbox consists of following elements:
- Title
- Text
- JSP File
Template Two Listbox
With the linkbox resources are shown which are collected with a OpenCms resource collector, for example the collector "allInFolder". A template two listbox consists of following elements:
- Title
- Text
- Image
- AdditionalLink
- Links
- Collector
- Parameter, this are the parameters to the selected folder, example: the collector "allInFolder" needs the parameters in the format <folder>|resource type|number of resources
- Detail Link Text
- Position - Author
- Position - Date
- Position - Image
- Mapping
The Template Two Listbox can be integrated in Template Two Articles, Template Two Items and Template Two Events.
Usage examples of the template two resource types
In this chapter are shown some usage examples of the template two elements.
'Hello World' example
To produce a 'Hello World' example in the standard Template Two layout, following is to do to:
- Create a Jsp with following content:
<%@ page session="false" %> <%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %> <cms:include property="template" element="head" /> Hello World <cms:include property="template" element="foot" />
- Set the template property to /system/modules/org.opencms.frontend.templatetwo/templates/main.jsp