Rendering Section Page Layouts
Note that what is defined in the layout-groups
resource is the logical structure of the section
page layouts, not their graphical appearance. It specifies the
containment rules for groups and areas, but it does not say anything
about where they are located on the page (although the names in the
example hint at locations), nor does it say anything about the
appearance of the groups and areas. These things are all defined in
your JSP templates.
In order to write a template that renders section pages correctly, you
have to know the section page layout's logical structure. For a
template that renders the section page layout discussed in this
section, see Section Page Templates.
In a more complex publication with multiple section page layouts (root
groups) it would be necessary to first test the section page's root
group to find out which layout is in use. The following code uses the
JSTL choose
element to distinguish between our
news
and simple
layouts:
<c:choose> <c:when test='${pool.rootElement.type == "news"}'> ...generate news layout... </c:when> <c:when test='${pool.rootElement.type == "simple"}'> ...generate simple layout... </c:when> <c:otherwise> ...handle error... </c:otherwise> </c:choose>