OpenWGA 7.10 - OpenWGA Concepts and Features

Design and development » WebTML » Basic concepts » Design References

Going up folders

The double point symbol "..", known from regular file systems, may also be used to address parent folders of the current resource.

Imagine a WebTML module "home:info:portlet" which wants to include another WebTML module "home:panels:actions". To adress the latter from the former a local reference cannot be used as both modules are not in the same folder, just somewhere inside the same root folder "home".

You could of course include the "actions" module by simply specifying the whole reference. But you could also do:

<tml:include ref="..:panel:actions"/>

You can also use multiple ".." symbols divided by a semicolon to go up an unlimited number of parent folders. For example, this would address the same module:

<tml:include ref="..:..:home:panel:actions"/>

The ".." symbol also may be be practical when introspecting designs from TMLScript using the resolve() method on the Design object.

Imagine you want to retrieve the names of all WebTML modules in folder "home:panel" so you could serve them for some setting. You could do the following, still from the "home:info:portlet" module:

WGA.design().resolve("..:panel").getTMLModuleNames("html")

Why would you prefer to address resources relatively instead of always specifying the whole resource reference? It keeps you independent from future reorganisations of your design folders. In the examples above you could move the "home" folder to some other location without breaking any of these relative references. However the places where this is reasonable may be a matter of individual taste.