Can I disable the + Section button in the sidebar for non-admins?

I have been asked to do a number of simplifications of the Discourse interface.

One of these is to remove the + icon at the bottom of the sidebar (which is used to create new sections within the sidebar), preferably only for non-admins, but if necessary, for everyone.

Can anyone advise how to do that?

1 Like

You can use CSS to hide it:

In common css of a theme or theme component:

.sidebar-wrapper .sidebar-footer-wrapper .btn-flat.add-section {
    display: none;
}

If you want it to be available for staff-only, then you can do this:

.sidebar-wrapper .sidebar-footer-wrapper .btn-flat.add-section {
    display: none;
}
.staff .sidebar-wrapper .sidebar-footer-wrapper .btn-flat.add-section {
    display: inline;
}
6 Likes

Thanks so much Lilly! That looks perfect.

Can you point me in the right direction for how best to implement these kinds of css tweaks?

I’m using the Air theme which does not provide access to css overides (or at least I don’t know how it does), and I’m on a hosted Discourse account from Communiteq, so I don’t have any access to files in Docker.

I want to make these changes in a way that is the least likely to break with new Discourse or template releases.

So what would you recommend? Would it make sense to create a custom theme component for this particular customer with just a few bits of css? Or something else?

Thanks!

1 Like

Creating a theme component is the way to go!

  1. Go to CustomizeThemes

  2. Click on the Install button.
    image

  3. Select + Create New

  1. Enter a name and validate.

  2. Now, you can include your component in the Air Theme, and you can Edit CSS/HTML!

image

image

I hope that helps! :slightly_smiling_face:

2 Likes

Thank you so much Lilly and Arkshine. That worked great. :smiley:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.