ThemeBuilder for Confluence Server and DC

Switching Panel Content with flagLogic

For ThemeBuilder version 5.5.0+ / Confluence 5.9.7+ the flagLogic method has been changed. Please see the main panel for the logic that controls which sidebar panel to show.

Flaglogic is conditional code that controls the display of panel or macro content. It uses the Flag Macro to set or change a value that can then be used by other macros like Panel Show and Panel Hide. See Working with Flags for a detailed explanation of flagLogic.

Example that detects Login page and shows related content:

The flagLogic Panel

The Set Flag Macro creates the login flag and gives it a default value of false.

<ac:macro ac:name="set-flag">
<ac:parameter ac:name="name">login</ac:parameter>
<ac:parameter ac:name="state">false</ac:parameter>
</ac:macro>

The Panel Show Macro can use the Confluence decorator value of login to only show its contained code on that condition.

<ac:macro ac:name="panel-show">
<ac:parameter ac:name="decorator">login</ac:parameter>
<ac:rich-text-body>

The Set Flag Macro is now used to set the login flag to true.

<ac:macro ac:name="set-flag">
<ac:parameter ac:name="name">login</ac:parameter>
<ac:parameter ac:name="state">true</ac:parameter>
</ac:macro>
</ac:rich-text-body>
</ac:macro>

The Main Panel

The Panel Import Macro will use the parameter 'flag=login’ to show the login panel, which contains content limited to the login and logout pages.

<ac:macro ac:name="panel-import">
<ac:parameter ac:name="panel">login</ac:parameter>
<ac:parameter ac:name="flag">login</ac:parameter>
</ac:macro>