More flexible commenting in Atlassian’s Confluence

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.

  1. Enabling comments in a space and then selectively “disabling comments”
  2. “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.

David is a senior developer and solutions architect at AppFusions based in Nottingham, England.

AppFusions
AppFusions solves mixed-technology integration problems. We bring engineering and business workflows together, you can work better, faster and smooter.

AppFusions is headquartered in San Francisco, California and works with enterprise vendors and partners such as IBM, Jive, DropBox, Box and Atlassian.

11 comments on “More flexible commenting in Atlassian’s Confluence

  1. Pingback: F. Nonnenmacher
  2. Steve Smith says:

    THANK YOU very much for this very straightforward implementation. Works great, very simple. Not sure why this isn’t in the core Confluence implementation. Again, thanks.

    1. David says:

      @Steve: You’re welcome. Glad it’s helpful.

  3. Jeremy Swan says:

    Thanks for sharing! This worked great.

  4. @dvdsmpsn says:

    “@jeremyswan: Thanks for this helpful workaround! http://t.co/ojaE6CFg8K More flexible commenting in Atlassian Confluence” you’re welcome :)

  5. Gregg K says:

    Nice article.

    Is there a way to make certain comments visible only to certain groups? For example, internal employee comments visible only to those in the employee group?

    1. Hi Gregg,

      It’s certainly very possible, but you’re looking at a custom plugin or edited theme for that.

      This is the kind of thing we’d consider as an enhancement to AppFusions’ Private Parts for Confluence add-on:
      http://www.appfusions.com/display/PPARTS/Home

  6. Gregg K says:

    Thanks for the quick response! We’ll…uh…definitely look into PParts.

  7. @pevsa says:

    Dear David,
    the macros are working fine. Now, the comment on all pages has been suppressed, but I have to allow it on the attlassian blog environment and could’n find the right page to place the {show-comments}.

    1. I’m not sure what you mean here. Could you explain a little more.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

WP-SpamFree by Pole Position Marketing