OpenWGA 7.10 - OpenWGA Concepts and Features

Design and development » WebTML » Features » Portlets

Including a WebTML module as portlet

Like stated before WebTML portlets are actually just another way of including a WebTML module. That's why <tml:include> is also used to include portlets. 

<tml:include type="portlet" ref="portlets:userinfo" name="userinfo"/>

You simply need to use type="portlet" or directly use the shortcut tag <tml:portlet>. Then, as usual from normal includes, tell the tag which WebTML module should be included as portlet with attribute ref. A WebTML module needs no special declaration to be included as portlet. You actually can do this with every WebTML module containing any code. But: To really utilize the portlet features the code of this module of course would need to use them.

Additionally to the module reference a portlet needs one more thing: A name, specified by the equally named attribute. This name identifies the portlet in the portlet hierarchy, to be described later.

Basically the WebTML module referenced by "ref" attribute is simply included as normal with <tml:include>. We call this module the portlet module in this context. The code of that module runs normally, just like on a normal include, but now is able to use additional features only available when it is rendered as a WebTML portlet.