valiantys-logo
Back

How to hide certain contents of a Confluence page from or show them to users

Visibility is an app developed by ServiceRocket and available on the Atlassian Marketplace. It allows one to display or hide sections of the contents of a Confluence page from a user according to different criteria, such as rights, group membership, page ownership, and even display mode and web browser properties.

The Visibility plugin has changed a lot since its first release. Many macros have disappeared in order to refocus on the essentials with “show-if” and “hide-if”. As their names indicate, these macros allow one to show or hide the contents of a page if certain conditions are satisfied.

The fact that it is free and has many use cases has made this app popular and widely used in implementations. You can decide to display parts of a page based on a team’s group membership, or simply leave instructions invisible in reading mode. Hidden information remains accessible via the “view source” action, so it is not a safe solution for hiding sensitive information.

But since January 2019, and version 5.0, Visibility has become a paid app. So if you are a user, be aware that when you reach the end of your license (or its renewal date), your app will not work unless you buy it. Fortunately it’s still affordable at $150 for 250 users, $1,000 for 10,000 users, and $1,500 for unlimited users.

If you prefer an alternative to this app, be aware that much of the functionality provided by Visibility can be natively covered with user macros.

The implementation achieved by these user macros does not entirely cover the scope offered by the Visibility app.

Here are the features included:

  • Named users
  • Group membership
  • Rights for a page or space
  • The type of display—Be careful, as only the PDF export will be available with the “printable” option
  • All conditions / one condition

A user macro is a macro that has been declared and defined by the Confluence administrator, and that can process content or display additional content. Creating a user macro requires some skill in development and knowing how to read the Java API.

Here we reveal how to replace Visibility with a native solution.

  1. First of all, you will have to disable the Visibility app, since it will be replaced by user macros
  2. You will have to modify the CSS to be able to choose to hide certain parts of the Confluence page during PDF export
  3. Finally, you will have to create 2 user macros

Let’s get to the heart of the action now.

Creating the “Hide-if” user macro

MODIFYING THE CSS

Adding CSS to the PDF Style of your instance

 

CREATING THE USER MACRO

Follow the instructions for creating a new user macro using the following settings:

Name of the macro: hide-if

Visibility: Visible to all users in the macro browser

Title of the macro: Hide-If

Description: Hide content when conditions are met

Categories: Confluence Content

Macro body processing: Rendered

Template

That’s it—your users can now hide parts of a Confluence page according to the conditions that they choose.

Creating the “Show-if” user macro

MODIFYING THE CSS

Adding CSS to the PDF Style of your instance

 

CREATING THE USER MACRO

Follow the instructions for creating a new user macro using the following settings:

Name of the macro: Show-if

Visibility: Visible to all users in the macro browser

Title of the macro: Show-if

Description: Show content when conditions are met

Categories: Confluence Content

Macro body processing: Rendered

Template

You will now be able to show content only if certain conditions are met.

The choice is yours

As you may have understood, depending on your situation and your internal resources, you can either buy the Visibility app or create a workaround by making two user macros that will provide you with essentially the same functionalites.

If you have any questions, don’t hesitate to contact our Atlassian Certified Consultants.

Cutted Triangle

Subscribe to Valiantys Newsletter

Registered request ! Subscribing... This is not an email An error occured

In accordance with our privacy policy, we are committed to respecting your personal data.

Contact us

Our Atlassian certified consultants will be happy to answer you.

Join us

We're building the next dream team - Are you in?

Follow us

We use cookies for the operation of our website. This is to improve its use, to personalize your experience, and to compile visitor statistics. By continuing to use this site, you consent to this policy. You can manage the settings and choose whether or not to accept certain cookies whilst browsing. For more information, see our privacy policy. Our privacy policy

Privacy settings

In order to facilitate your navigation and to provide you with the best possible service, we use cookies to improve the site to the needs of our visitors, particularly according to the number of visitors. For more information, please read our privacy policy. Our privacy policy

Recaptcha

Google reCAPTCHA is a system designed to distinguish humans from computers, so that bots are unable to maliciously fill out forms on behalf of a human being.

Analytics

Used to send data to Google Analytics about the visitor's device and behavior. Tracks the visitor across devices and marketing channels. Used by the social sharing platform AddThis to store the user's usage history of the AddThis sharing widget. Registers a unique ID that is used to generate statistical data on how the visitor uses the website.