The discussion “Hide sidebar from anon users” is about a theme component that hides the sidebar from anonymous users on Discourse forums. nathank introduced the component, which adds CSS to provide a cleaner experience for anon users. This is useful for predominantly private sites with limited public content.
Ayelen_Rives found the component useful and asked if it’s possible to show only certain items on the sidebar to anon users. nathank provided a CSS solution to target specific sidebar sections.
Lilly created a more powerful version of the theme component, and nathank decided to deprecate the original component in favor of Lilly’s version, which includes the functionality of the original 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:
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.
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!