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).
Is my CSS wrong, or is there another way to achieve the same outcome?
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:
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Meet the engineers who are making the Confluence magic happen at Atlassian ✨
RSVP now!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.