Show If
Description
This macro will show its contents to the viewer if the context matches the parameters specified.
If you have large content on Cloud, consider breaking it into smaller chunks over multiple Show If macros to avoid performance issues.
Some legacy Macro parameters from the Confluence Server are not supported yet. More details are on our FAQ page.
In Confluence Cloud, the legacy Macro parameters will be shown in a section that is accessible by showing and hiding the legacy field parameters dropdown.
If the migrated macro has no legacy parameters, the "Show legacy field parameters" dropdown will not be visible in the macro editor.
Though helpful in preventing certain content from being seen by specific users, this macro is not a comprehensive security solution. The user may be able to view the content easily via other means, such as editing the page. Be aware that content is only hidden in the Confluence page view and is still available when editing a page, viewing page history, email notifications, etc. To secure sensitive information, use the Security & Encryption app instead.
If the macro is added to a page with default values for all parameters, by default, the content within the macro body will not be displayed after the page is published. This happens regardless of the value of the Match Using parameter, either all, or, any.
Parameters
Name | Required | Migratable to Cloud? | Default Value | Description |
---|---|---|---|---|
Start Date | (X)
| NO
|
| The date and time from when the content should start being displayed, with respect to the server’s timezone. The system will not enforce date and time restrictions if no value is set. |
End Date | (X)
| NO
|
| The date and time from when the content should stop being displayed, with respect to the server’s timezone. |
Match Using | (X)
| YES
| ‘any’ | Set to “all” or “any. “
For example:
User groups added - A, B, C The “user“should be part of all the groups A & B & C for the content to be shown with the Match Using: All criteria. If the user is not part of C, then the content is not shown in this scenario.
User groups added - A, B, C The “user“ can be part of any group (A, B, or C) for the content to be shown with the Match Using: Any criteria. |
Users | (X)
| YES
|
| The list of user(s) to match. Type the username and select from the dropdown option. |
Special Username | (X)
| YES
|
| The user to match, using unique usernames:
|
User Groups | (X)
| YES
|
| The list of user group(s) to match. Type the group name and select from the dropdown option. (Cloud only) The group(s) to match are separated by a comma or semicolon (Server and Data Center only). e.g., 'confluence-users' will match all logged-in users. |
Space Permissions | (X)
| NO
|
| This property allows you to define whether the content” then followed by permission type, e.g.,
These are the permission types:
|
Content Types | (X)
| NO
|
| The (list of) page types. May be:
|
Display Types | (X)
| NO
|
| This property allows the user to show content only in a document exported to PDF or Word and not on the Confluence page. The (list of) display modes:
For more detailed information on Display Types usage and behaviors, check the Display Types parameter matrix page. |
Current Space | (X)
| NO
|
|
The list of space keys for the spaces this will be displayed in. |
Action Types | (X)
| NO
|
| The action taking place:
|
Labels | (X)
| NO
|
|
The list of labels to test is present or absent. For more detailed information on Label usage and behaviors, check the Label parameter matrix page.
|
HTTP Headers | (X)
| NO
|
| The list of request header "name:value" pairs to check for. This can either be of the form "name:exact value" or "name::regular expression" (note the double "::" for regular expressions). For example, to check if the current browser is Firefox, set to This will confirm that the 'User-Agent' header contains 'Firefox'. What headers are available will depend on the browser being used. |
Scope | (X)
| NO
|
| (Since 1.6.0) Tests if the current location is in the specified scope. You can specify a particular page or set the scope to the children, descendants, or ancestors of another page:
|
Trim | (X) | NO |
| If set to |
Tutorial Examples