+

Search Tips   |   Advanced Search


Page builder layout templates

You can create templates to control the layout of pages.

Page builder layouts do not use the tag <portal-core:screenRender/>.

If you have a page builder layout assigned to your page, it uses a JSP include instead to render the layout model contents. Each layout has its own JSP template located in the directory profile_root/installedApps/cell_name/Enhanced_Theme.ear/wp.theme.enhancedtheme.war/themes/html/Enhanced/layouts.

The file 2columnEqual.jsp has the two column layout which is the page builder default:

taglib uri="http://java.sun.com/jsp/jstl/core" 
    prefix="c" %><%@ taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.0/portal-fmt" 
       prefix="portal-fmt" %><%@  taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/sample/simpletheme" 
       prefix="simpletheme" %>

<simpletheme:init/>

<c:set var="layoutmodel" value="${wp.layoutModel[wp.selectionModel.selected]}"/>
<c:set var="containers" value="${layoutmodel.children[layoutmodel.root]}"/>

<portal-fmt:identification object="${containers[0]}" action="serialize" 
       var="containerID">
   <div class="ibmPortalContent2Col ibmPortalLayoutContainer ibmPortalMainContainer" 
        id="<%=containerID%>" orientation=V ordinal=0 directions={right:'1'}>
      <c:forEach var="currentPortlet" items="${layoutmodel.children[containers[0]]}">
                 <simpletheme:renderNode layoutNode="${currentPortlet}"/></c:forEach>    
   </div><!--end colRight-->
</portal-fmt:identification>

<portal-fmt:identification object="${containers[1]}" action="serialize" var="containerID">
   <div class="ibmPortalContent2Col ibmPortalLayoutContainer ibmPortalRightmostColumn" 
        id="<%=containerID%>" orientation=V ordinal=1 directions={left:'0'}>
      <c:forEach var="currentPortlet" items="${layoutmodel.children[containers[1]]}">
                 <simpletheme:renderNode layoutNode="${currentPortlet}"/></c:forEach>
   </div><!--end colLeft-->
</portal-fmt:identification> 

In the code above, an expression language (EL) bean is used to get a reference to the layout model object and the containers array, which consists of the children of the layout model root node. The page builder theme does not support nested containers. Therefore each container holds only controls, such as portlets Below the EL references is the markup for the two columns, which are simply HTML div nodes. Each is surrounded with a <portal-fmt:identification/> tag that serializes the ID for the given container from the containers array. In order to function properly in the page builder theme, the div nodes need the following attributes to be present:

All other attributes and CSS classes are added by the designer of the layout. The column div nodes contain forEach tags. They loop through each control in the given container and render it by calling the <simpletheme:renderNode layoutNode="${currentPortlet}"/> tag.


Parent topic:

Changing page layout