Hide sidebar from anon users

This TC has been deprecated in favour of:

:information_source: Summary Hides the sidebar from anon users. This is helpful if you have a mostly private site with a small amount of content publicly visible.
:hammer_and_wrench: Repository GitHub - nathan-nz/discourse-hide-sidebar-from-anon: Hides the sidebar from anonymous users
:question: Install Guide How to install a theme or theme component
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

This simple theme component adds in CSS to give a cleaner experience for anon users by hiding the sidebar.

You might want to do this if (like us) you have a predominantly private site which has one or two categories set to everyone (and thus exposed to the internet). It means that casual visitors see a very simple interface that is congruent with the small amount of content they see, while logged in users get the full experience.

This was put together from the code kindly provided by @Don here:

18 Likes

Thank you! It’s really useful and I’ll give it a try.

Do you know if there is a way to show only some things on the sidebar and don’t show others? For instance, I don’t wanna show to anon the Community tabs, but I do wanna show them categories and tags.

3 Likes

That is pretty straightforward with a bit of CSS targetting .anon:

.anon div.sidebar-section-community {
     display: none;
}

If I get the chance I’ll roll that functionality into this TC.

3 Likes

Thank you! :sparkles: That’s great!!

2 Likes

thanks @nathank. i thought about adding your theme’s functionality to mine but i’ve left it out because it seems like a special case component for forums with private small membership, and yours works just fine. cheers! :slight_smile:

Nah, I think that it is time to depreciate this one now that it’s functionality has been rolled into yours:

4 Likes