Confluence users often ask me how the Confluence permissions model works. A reoccurring theme is the ability (or lack thereof) to selectively show or hide comments in a space on an ad-hoc basis.
The current feature set of Confluence allows you to either enable or disable comments on a per space basis. For some users this can seem overly simplistic. Though we don't really want to change the way that Confluence works under the hood, perhaps we can give the appearance of a more granular commenting permissions model. In this way, CSS can be used to show or hide the comments block.
There are 2 ways of approaching this problem.
- Enabling comments in a space and then selectively "disabling comments"
- "Disabling comments" in a space by default and then selectively "enabling comments"
Either way works, but different people have different needs. Choose whichever is appropriate.
This article requires a couple of user macros
Hide Comments
## User Macro hide-comments
## Usage: {hide-comments}
<style type="text/css">#com-atlassian-confluence #comments-section { display:none; } </style>
Show Comments
## User Macro : show-comments
## Usage: {show-comments}
<style type="text/css">#com-atlassian-confluence #comments-section { display:block; }</style>
Enabling comments in a space and then selectively "disabling comments"
Simply add {hide-comments}
to a page et voila - no commenting functionality is displayed
"Disabling comments" in a space by default and then selectively "enabling comments"
Edit the custom space stylesheet. Add this:
/* hide comments by default */
#com-atlassian-confluence #comments-section { display:none; }
On each page that you want to allow comments, add {show-comments}
. This overrides the CSS for div#comments-section
allowing the commenting functionality to be displayed.
For extra points
If you're using the Documentation theme, you can include a common footer to drive comments to a single page within the space, e.g.
Add the following to the footer
[Add a comment|Comments]
Create a Comments page where your comments will all be amassed
On the comments page, add the user macro
{show-comments}
That's it. With a sprinkling of CSS and some very simple user macros, we can effectively turn commenting on and off at will in a more granular manner.