Templates and Widget Simplicity

Templates are used to layout categories and pages and how they are displayed. Widgets elements that encapsulate functionality that can be reused across templates or added directly in content using the editor.

Templates

Templates determine the layout of categories and pages. Template use XHTML markup to create the page structure. Cascading Style Sheets (CSS) control the visual design of the page. Templates can be assigned to individual categories and pages however in most cases a typical site will use only a few category and page templates. Applying individual templates allows you to change the display format to suit the content requirements.

Templates are not limited to displaying AssetNow NX content for web browsers. The output of a template is determined by the template design and any widgets and custom code used by the template. You could use a template to add a new function or application to AssetNow NX.

You can also transform content using templates. When the content is rendered AssetNow NX will apply the transformation template. Content can be transformed by applying scripting to process/parse content (regular expressions, or other scripting techniques), or by applying XSLT stylesheets. In other words AssetNow NX does not restrict the type and format of output you can generate. The output is not restricted to web browsers. You could transform content for a specific device or collaborating service.

Widgets

Widgets are tags that encapsulate functions. Widgets are used inside templates in the same way you use XHTML markup tags to design web pages. Widgets can be as simple as a static list used for a simple navigation element or as complex and contain an entire application of component such as a shopping cart. Widgets can include other widgets allowing developers to create very modular and easy-to-maintain components.

AssetNow NX has numerous standard widgets for navigation, site map, search, category content and page display etc. Typically designers and developers will customize these for to their site design needs. Designers and developers can also create their own widgets and so build up a library of unique functions which they can offer clients.

AssetNow NX also provides a widget tool that allows you to create and change widgets directly from your web browser.

By using widgets developers can add new functionality for use by site designers without worrying about the widget code being altered and the site performance compromised. Designers do not have to be concerned with the internal operation of a widget and only need to know the syntax (attributes) used to apply the widget tag.

Example

Below is an example template for a typical site home page, the category and page templates are very similar. Visual design is determined entirely by CSS, as you can see in the example below. AssetNow NX ensures complete separation of content from presentation. So if we want to take the same content and deliver it to a special device all we need to do is create a template and the required CSS (or XSLT/processing for transformation) to do it.

AssetNow NX Template and widgets

Typical AssetNow NX template containing XHTML markup and widgets

Widgets allow developers to hide complexity from designers. In the above example the XHTML document declaration, header, stylesheets and body sections are all created by widgets.

If we want to add a new stylesheet or javascript for use by all our site pages we just need to add it in <widget:header/> to have them added to all the pages.

Widgets can also be excluded from caching as in the example above: <widget-nocache:ticktime/>. If we did not exclude this widget from the cache then it would add the time stamp from the page that was cached and not update on every page load.

Templates and widgets combined with standards based designs using XHTML and CSS result in an efficient and easy-to-maintain site.

Templates also make it easier to ensure valid markup, compliance accessibility requirements, and providing custom content output for specific devices.

Location

http://www.assetnow.com/index.cfm/1,82,262,0,html

Copyright © Orbital Limited 2012

Learn More        Try It Now!        See Versions and Pricing