Template Concepts

Basic Template Concepts

A template is used to display information in a user configurable manor. A template is a fragment of html with a few custom extensions. Most of the custom extensions are enclosed in curly braces, {}. There are two extension, <repeater></repeater>, that look similar to standard html and <%sometext%>.

The <repeater> element is used to repeat sections of the template. There is a required attribute for the repeater element and it must be enclosed in curly braces,{}. This attribute is the property that will be repeated.

The <%sometext%> element is used to localise text. The text between <% and %> is a key in the Cadcorp.Web.Templates.resx file. These tags are processed on the server and the localised text is inserted into the template.

Generally the contents of the curly brackets will be a property name. Any valid html elements can be used in a template. Remember as a document fragment is being created <html> and <body> tags should NOT be used. Any valid attributes can also be applied to the elements.

Local Knowledge supports multiple templates and SWDs. This allows different queries to be run from the same web service, depending on the map.

Advanced Template Concepts

Conceptually, an object is passed to the template and its properties can be used to display the results. As the results are processed in javascript, the object passed to the template is a javascript object. This has a few benefits:


Send comments on this topic.