I want to create a custom section in the sidebar, but because it will have a few items and I don’t want the categories to be pushed too far down, I would like the section to be collapsed by default when a user signs up and until they decide to expand it. Is it possible?
I have this TC I made a long time ago. I just quickly updated it to work with the latest version. Give it a try! EDIT: by default it collapses everything, you can define what section to ignore. Maybe I should add a section to choose what to collapse instead.
Thanks for sharing!
I installed it and I have a few questions:
1 - “Community” refers to the custom sections?
2 - There’s no “Channels” option?
3 - How would I pick a specific Custom Section to exclude? (EDIT: I guess for now I need to go to Inspect and get the data-section-name
?)
EDIT: By using Inspect, I noticed that “Community” refers to the section at the top with “Topics”, “My Posts”, etc. So I’m confused by this, because that section by default is not collapsible. Does you TC make it collapsible or is this a bug?
I also noticed that for “Channels”, it’s chat-channels
so maybe you could include that in the description where it says The Discourse sections name are:
As a test I set it like this:
but it’s not working on the Categories section, for example. It’s not collapsing.
Since I would like to try it on a non-admin account, I’m using Chrome’s incognito mode. I also tried in a different browser that I never used to visit the forum, not in incognito mode. It’s not working on any of those.
I think both options are valid. I guess it depends on how you approach it. You can have it the way you have it now, but by default make the component add all the default sections to make the plugin exclude those by default, and then the user can just remove those; or have it the way you have it and only have 1 excluded just as an example and then we add the other ones.
One thing that I would find very useful is if we could set exclusions per section of the website by adding part of the url. For example I could create a section that only shows if after my domain example.com
the url starts with tag
so in a url like example.com/tag
or example.com/tags
or example.tag/business
it would always exclude. That way I can create sections specifically for certain parts of the forum. We could add as many “rules” as we need with a simple “Add New Rule” or something like that.
Right now in certain sections I’m using the Documentation plugin to achieve this, but I’m not a fan of it hiding the normal sidebar content and then we have to click “Back to the Forum”. It kinda feels like we went to a different forum. So if your component could do this, that would be great!
Would it be possible for the component to scan all available sections and show them in a dropdown menu that lets us just click to add and then the X next to it to remove? Similar to this:
or this:
This would make it easier for an admin who isn’t very familiar with the Inspect and all that.