(Quick Reference)

theme:ifZoneContent

Purpose

Executes the body only if there is content explicitly defined for the specified content zone.

Content zones can have optional content, and if the application's GSP definescontent for a zone, you can check this.

For example your theme may render alternative content on the "sidebar" layout if there is no content defined for the sidebar, and render the sidebar decoration if there is some content.

This can be used within Theme layouts and application/plugin GSPs.

Example

<theme:ifZoneContent name="panel1">
    <div class="leftpanel">
        <theme:layoutZone name="panel1"/>
    </div>
</theme:ifZoneContent>

<theme:ifZoneContent name="panel2">
    <div class="centerpanel">
        <theme:layoutZone name="panel2"/>
    </div>
</theme:ifZoneContent>

<theme:ifZoneContent name="panel3">
    <div class="rightpanel">
        <theme:layoutZone name="panel3"/>
    </div>
</theme:ifZoneContent>

The above allows the application developer to define only the panels they require, and no content will be rendered if they have not defined some of them.

Attributes

NameRequired?Description
nameYesThe name of the zone that you wish to test for content