ShowIf — Confluence Cloud Macro
This macro checks if the current user belongs to a specified group, and if so, displays a block of content. It uses a foreach loop to iterate through the user's groups and compares them with the target group using $StringUtils.equals().
User Parameters
This macro comes without configurable user parameters.
Template
## Show content if user is in the following group
#set($adminGroup = "site-admins") ## Your group name in this line
#foreach ( $item in $user.groups )
#if ( $StringUtils.equals($item.name,$adminGroup) )
## Text below will be printed
<b>Text that will be shown only to site admins</b>
#end
#endRecommended Macros
Filter Confluence groups based on a specified filter value and display the results in different formats.
Retrieve and display labels from a specified space.
Display Jira issue comments in a table
Display a list of Confluence pages with CSV download feature
The content of this macro will not go to the printing page
Add a configurable floating panel to a Confluence page
An overview of all pages within one space which contains the title, the version, and the last updated date
Improve default Confluence tables with sorting, filtering, pagination, and CSV export features