Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Hide comments section at the bottom of wiki pages except on blog pages

flaimo
Contributor
February 1, 2019

We would like to hide the comments section at the end of all wiki pages, except when it is a blog page. Inline comments should still work on all pages. Users should not have to include a user macro every time.

I have tried the following custom CSS in my local confluence 6.14 instance based on the official docker image from atlassian and the following line works

<style>body:not([class~=“view-blog-post”]) #comments-section { display:none; }</style>

If I put the same code in our real 6.14 system all comment sections are hidden including the ones on blog pages, even though they should still be visible. (see screenshot of developer tools).

hide_comments_except_for_blog_posts-2.png

 

Is my CSS wrong, or is there another way to achieve the same outcome?

1 answer

1 accepted

0 votes
Answer accepted
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 4, 2019

Hello Flaimo,

I tested your CSS on Confluence server 6.14 and confirmed the same outcome you are experiencing. The Comment section was hidden on both a blog and regular page. I reviewed you CSS and found a small syntax issue that resolves the problem in testing. Your CSS should look as follows:

body:not([class~=view-blog-post]) #comments-section { display:none; }  

Please note the <style> is removed and the quotes on view-blog-post are removed. Here is a screenshot of the results of this CSS:

 image.png image.png

Something to be aware of, while hiding the comment section will remove it from plain sight. A user may still enter the developer tools in a browser and make the comments visible to themselves and then enter/view comments. The above is a good deterrent but does not remove the ability to add/view comments.

I hope you find this helpful and you’re able to hide comments within a page.

Regards,
Stephen Sifers

flaimo
Contributor
February 5, 2019

that did the trick. thanks. we know about the limitations of this hack, but most users probably don't know what the developer tools are. we just want to encourage them, to use the inline comment function for pages where the content can change over time, in contrast to a blog post.

Like Stephen Sifers likes this

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian community events, ace, engineering, confluence feed, power of feed, atlassian ask me anything, atlassian confluence answers, ace rsvp, atlassian community events rsvp, atlassian magic

“How We Built This” ft. Atlassian Confluence Engineers

Meet the engineers who are making the Confluence magic happen at Atlassian ✨

RSVP now!
AUG Leaders

Upcoming Confluence Events