•  
Main
About Hippo Portal
Documentation
Community
Other

Getting started: layout for home page

The home page for the Getting Started Portal is located at

c:/projects/gettingstarted-portal/src/webapp/WEB-INF/pages/__site1/home.psml

This page defines fragments that are available for the page, but not how and where these fragments should be placed for the page. This task is done by means of a layout, that is referenced by the page in the layoutType preference:

<fragment id="home" type="layout" name="jetspeed-layouts::SimpleLayout">
  ..
  <preference name="layoutType"><value>default</value></preference>
  ..
</fragment>

By default, the layout is mapped to the Velocity template located at

c:/projects/gettingstarted-portal/src/webapp/decorations/layout/default/default-layout.vm

This generic template renders the content of the root fragment ("home") placing child fragments below each other in div elements.

To change this behaviour and use a layout fixed for the home page, change the layoutType preference to the value home. Now, the page uses this file for the layout:

c:/projects/gettingstarted-portal/src/webapp/decorations/layout/default/home-layout.vm

To implement a fixed layout for the portlets used in the Getting Started Portal, edit this file and replace the contents with the following:

<table border="0" cellspacing="10" width="100%">
  <tr>
    <td valign="top">#includeFragment($myPage "home-HelloWorld")</td>
    <td valign="top">#includeFragment($myPage "home-PickANumberPortlet")</td>
  </tr>
</table>

This will place the output of the Hello World and Pick A Number portlet next to each other in a two-column table.

For more information about how .psmls, layout templates and decorators work, read the Jetspeed documentation guides about these topics.