Groups provides the following blocks that are used to restrict the visibility of the content they contain:
- Groups Member Block
- Groups Non-member Block
The Groups Member Block is used to show its content to group members only and it can contain any other arbitrary blocks.
The Groups Non-member Block allows you to hide its content from group members.
These blocks can also be nested and combined with other blocks as needed.
Groups Member Block
This block shows its content to group members. When you use this block, you will select one or more groups for it so that the block’s content is visible to them.
Here is an example where the block simply contains a paragraph of text and is restricted to registered users. We just have to select the Registered group in the block’s settings.
Groups Non-member Block
This block allows to hide its content from group members. As with the previous one, you are going to select one or more groups for it and it will hide its content from the members of those groups.
Let’s look at a simple example for this block. Here we show a paragraph of text to those users who are not registered or logged in. For this, we simply selected the Registered group in the block’s settings.
The example below shows these two blocks placed together on a page: