3.4.1. Spaces Templates

Warning

You are looking at documentation for an older release. Not what you want? See the current release documentation.

A space template allows you to configure layout of applications. In the example below, a container called "Menu" is placed on top of others. The container contains the SpaceMenuPortlet portlet:


<page>
    <owner-type></owner-type>
    <owner-id></owner-id>
    <name></name>
    <container id="SpacePage" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
        <container id="Menu" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
            <portlet-application>
                <portlet>
                <application-ref>social-portlet</application-ref>
                <portlet-ref>SpaceMenuPortlet</portlet-ref>
                </portlet>
                <access-permissions>*:/platform/users</access-permissions>
                <show-info-bar>false</show-info-bar>
            </portlet-application>
        </container>
        <container id="Application" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
        </container>
    </container>
</page>

In this example, the outer container "SpacePage" contains two inner containers: Menu and Application. These containers are displayed as below, where is "Menu" and is "Application":

Changing the order of these two inner containers will swap the display position:


<page>
    <owner-type></owner-type>
    <owner-id></owner-id>
    <name></name>
    <container id="SpacePage" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
        <container id="Application" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
        </container>
        <container id="Menu" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
            ...
        </container>
    </container>
</page>

If you want to display a container in the left and another in the right, place them in the UITableColumnContainer.gtmpl outer container:


<page>
    <owner-type></owner-type>
    <owner-id></owner-id>
    <name></name>
    <container id="SpacePage" template="system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl">
        <container id="Menu" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
            ...
        </container>
        <container id="Application" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
        </container>
    </container>
</page>

The sample code of space templates can be found here.

Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus