OpenWGA 7.10 - OpenWGA Concepts and Features

Design and development » WebTML » Basic concepts » Document collections

Navigators

A navigator is a document collection, which chooses the documents to collect from some "axis" of the page hierarchy. So for example a navigator could collect all main pages of an area or all child pages of some special page.

The page hierarchy of a content store should be organized to represent the organizational structure of the website. For example: The root pages of an area main might represent the main sections of the website. Their child pages may represent the subsections of those main sections. Given such a hierarchy a navigator should be able to collect main section or subsection pages by simply selecting the right axis of the hierarchy at the right point.

See the following illustration on how the navigators of the OpenWGA demo site reflect the page hierarchy of the app:

screenshot_11.png


WebTML Navigators are created using the WebTML tag <tml:navigator>, a derivation of <tml:foreach> which collects documents the described way. It may receive all the attributes that are also valid for <tml:foreach>. The attribute type however has a special meaning on navigators. It is used to determine the axis that the navigator should use to collect documents, for example:

  • type="children" collects all child pages of the current context document
  • type="siblings" collects the pages with the same parent document as the context document. If the current document is a root document these are all root documents of the area
  • type="path" collects all documents in the "path" of the context document. These are all documents from the root document down to the context document. In the illustration above the path of document "Product 1" would list: "Home", "Products".
  • type="sitemap" Collects all documents of the website.

As you see many navigator types are dependent on the context under which the navigator is executed. As usual the context attribute may be used to use a specific document context for the navigator. The only thing different from other WebTML tags is that with <tml:navigator> you do not directly choose the context used for the tag body. Instead you only choose the "reference document" for the navigator type that is used.

Because of this you could emulate the type "children" with the type "siblings" when going "down" one hierarchy level via context change. So the following navigators produce equal results:

<tml:navigator type="children">

  <tml:link><br>

</tml:navigator>

<tml:navigator context="children[0]" type="siblings">

  <tml:link/><br>

</tml:navigator>

For easier coding there are shortcuts for all navigator types: Simply use the content of the type attribute as tag name. So the following two navigators are again equal:

<tml:navigator type="children">

  <tml:link/><br>

</tml:navigator>

<tml:children>

  <tml:link/><br>

</tml:children>

Navigators put out the documents in the way they are ordered in hierarchy, so there is seldomly need to sort the output. However that is still possible using the <tml:foreach> sorting facilities described under Document collections.