Template
Digest
Concept
More Insight into Templates
In addition to the normal HTML elements, templates also allow for special system tags to be embedded that define the content regions of the document. These content regions are the areas where new blocks of content can be placed in a "building block" manner to create a resulting XHTML web page. Likewise, XSLT formats or Velocity Scripts can also be applied to these regions against a block asset to create XHTML content as well.
Once a template has been created in the system, a user may choose to the edit the template again where they will be presented with an interface to perform these block/format assignments to the various regions that might be available in the particular template. Each region is designated by a special HTML comment tag or XML tag where MY-REGION-NAME is replaced with the name of the region. An important note to consider is that all templates must contain a region called DEFAULT where a page's "default" content will appear from the data that the end user enters into the editing environment for any page that inherits the template. If a DEFAULT region has not been creatsed, the system will automatically create the region immediately after the opening <body> tag of the template document.
Changes to Template Properties with Cascade 6.x
With the release of Cascade Server 6.0, when within the context of a Site, templates are no longer linked to a specific Target to which to publish. With Cascade 6.0, templates are available in the Global Area (in which case they are still tied to Targets) and within the context of a Site (in which case they will simply publish to any Destination associated with a site). By adding the site element to the CMS and removing Targets as the key organizing principle for a given Site, users are now afforded the added benefit of being able to use and reuse templates within Sites while decoupling content presentation/format from publish Destinations to which site content publishes. In addition to separation of content presentation and publishing destinations, output types are now controlled at the page configuration level rather than being associated with a particular template. However, templates are still tied to pages via page configurations.
Template Sharing Across Sites
In versions of Cascade Server 6.2 and newer, templates may now be shared across Sites. System Administrators and Site Managers can collaborate to share single, centrally managed templates effectively across an unlimited number of Sites. This provides the ability to maintain a consistent look and feel across Sites while reducing the overhead and burden of making updates to multiple templates throughout the system.
Storing/Location of Templates
Templates can be housed in the Global Area and used with Targets as they were in previous versions. However, in order to share templates across Sites, they must be housed within a Site. Hannon Hill recommends setting up a Site that is only for commonly used assets, such as templates and CSS files. For example: common.site.com. This common "Site" can be used to house assets shared across multiple live sites.
Sharing Templates across Sites
When creating page configurations, users can select a template from a Site that is different from the Site in which the page configuration resides. However, users can not utilize a template being stored in the Global Area. When using a template from another Site, the key thing to consider is how any links contained within the template or contained within any blocks and/or formats assigned to template regions should be resolved. Links can be resolved in one of 3 ways depending on how they are constructed:
- relative to the Site in which the template, block, or format that supplies the link resides
- relative to the Site on which the template is being used (see [system-asset:local] tag)
- absolutely, based on the Site name and path specified in the link (see site://[site-name]/path link format)
Template System Regions
In order to insert content into a template, users must add System Regions. These regions are written into the template to indicate to the system where to place various content blocks.
The most important region to include in a template is the DEFAULT region. Wherever on the template you wish for the default content to be placed (typically just below the header), type it in. When a page is edited and content is added, it is placed into this region.
Other regions can be specified by simply adding code into the template wherever users wish for regions to appear. Users may name regions anything they like, but it's best to be descriptive. Typical regions include FOOTER, HEADER, BREAD-CRUMBS, LEFT-NAV, RIGHT-NAV, etc.
Assigning Cascade Elements at the Template-Level
The template is at the lowest level of the hierarchy. Assignments made at this level will carry over to the configuration set that inherits them.
If assigned regions are not meant to change from page to page within the site, they should be assigned at the template level.
Example:
Header and Footer blocks will be the same across all pages regardless of the configuration sets they use. As long as all pages use configuration sets based on that template, those Header and Footer blocks will carry over with them.
To learn more about how to assign at the template level, please continue on below to our "Technical" section.Technical
Creating Standards Compliant Templates
All templates must adhere to the standards that define well-formed XML documents. This includes, but is not limited to, maintaining lowercase tag names (i.e. <P> becomes <p>) and always appending opening tags with their closing tag counterparts (i.e. <p> cannot be left alone and must have an ending </p> tag after the paragraph content) unless the document type definition allows for the tag to be self-closing (i.e. <img src="myImage.jpg" > becomes <img src="myImage.jpg" /> with the closing slash. Documents that are not well-formed can be passed through an optional XHTML filter that will perform a conversion of the document structure to adhere to the XHTML standard.
For more information about well-formed XHTML documents, consult the W3C website below:
Creating a Template
To create a new template:
- Determine where you want to store the new template, and select the folder from the left asset tree. Typically, templates are reused for many pages and are stored in a central or common folder.
- Once in the desired folder, use the top navigation menu and select New-> Default-> Template.

- On the Content pane:
Type, or copy and paste, in the HTML for your template.
Note: Dreamweaver template markup is recognized when creating a new template. This can be used to quickly create regions and static block content. When importing a Dreamweaver template into Cascade Server, Dreamweaver template regions will become the regions in the Cascade Server Template and the content between the Dreamweaver template regions will be stored as XHTML Blocks. Those Blocks will automatically be assigned to the new regions on the new Cascade template.
*Note - In versions 6.4 and newer, the text editor displayed supports syntax highlighting for the for templates used in Cascade. The syntax-highlighting text editor can be turned on/off using the "Advanced Editor" button at the bottom of the editor. However, please note, doing so will only turn the advanced editor off for that single use of the editor. Upon creating a template or editing a template, the advanced editor will be on by default.
- On the Regions pane:
If there are already system regions set up in your template, you will see these listed here. For each region listed, you may select a default block and stylesheet. These selections may be overridden at the configuration and page levels. - On the System pane:
Name - Type in a name for your template.
Parent Folder - By default, this will be the current folder, however, this can be overridden
Assigning at the Template Level
How to Assign at the Template level:
- Select your template from the left asset tree, then click Edit.
- For the region in which you wish to add a block and/or format, click on the corresponding file chooser icon and select the desired block or format from the pop-up asset menu.
- Click Submit to save your changes. These assignations will be replicated throughout any page based on this template, but can be overridden at any stage.
All pages are based on templates, which provide the HTML structure for the page.
Populating Template Regions with Blocks and Formats
Once you have created your regions, you can populate them with blocks and formats at the template level. Populating your regions at the template level is useful when certain blocks and formats are to be used on multiple pages based on that template.
To assign blocks and stylesheets:
- Click Edit on the desired template, then click the Regions tab.
- For each region you wish to populate, select a block and/or format from the choosers.
- Click Submit to save your changes.
Assignments made at the template level are optional and may be overridden at the configuration or page levels.

Cross-Site Relationships
For more information on Cross-Site relationships for Templates, check out our Cross-Site relationship rules page.

