Custom sidebar sections being tested on meta

I made a new session in the left menu, with the list of options I chose, how do I make other sections defined by discourse disappear through CSS? I want to remove the community and categories section

2 Likes

That’s great! Search did not work for me. My tablet and the website could not agree to show the keyboard. As you can see it disappears without me tapping something.

That may be a problem with my tablet, but how do users of a forum know what they need to search for? Especially if the default language isn’t English.
If users want to choose an emoji they can choose one from the menu. They don’t need to search (in a foreign language). Maybe there should be something similar for the icon.

3 Likes

Indeed, this issue occurs my tablet as well as on phones on which the form layout isn’t optimized for:

3 Likes

custom sidebar sections is nice, but how about editing existing ones like Community or Categories? is that planned? if so, about how far out is it?

for now, i wrote a nice script using promises and MutationObserver. if you want to try it, you can make a theme component and paste this in the head section:

any kind of collapsing, expanding, and refreshing should just “do it” in a performant way.

when the sidebar mutates, a promise is created for each link that is resolved when the link’s relevant section is available.

specify injections by section. kebab must be text in kebab case.

i made various ‘positioner’ options.you can append or prepend a section. you can also add a link before or after an existing link in a section.

you can also remove links. just make removals an empty array if you’re not using that.

you can remove/comment out the few console.log statements used for debugging once you’re confident it works.

please let me know if you find bugs.

is it worth posting this as an actual theme component? again, i wonder if the real feature is coming.

3 Likes

Allowing admins to edit the Community section is pretty high on our list now.

What kind of customization for something like Categories did you have in mind? (Aside from adding/removing categories as you can do today)

4 Likes

i’m using tags instead of subcategories for most things. a problem with this is you have basically no control over how this is presented to users in the navigational sense. you can’t order, emphasize, or de-emphasize tags, and they don’t really appear on /categories like subcategories do.

best solution i have so far is to create a site map topic and link to it wherever it makes sense. that could include in the sidebar (atop Categories section or somewhere in the Community section).

full details in this post:

4 Likes

If you have any screenshots or mockups of what you’d like the Categories section to look like on your site, I’m curious to see what you have in mind.

3 Likes

Great to hear! Would it be possible to make those customizations apply for anonymous visitors as well?

4 Likes

hey dave, here are my thoughts.

imo on discourse, by default, /categories page more or less functions as a site map to browse and find topics unless you want to see a feed like /latest.

for one thing, i want the site map (whatever it may be) to be more prominently displayed than at the bottom of the Categories sidebar section. my first thought was to have the All Categories link (/categories) moved to the top of the sidebar section.

however, i am mostly using tags (with rules assigned to categories via tag groups) for structure in the place of subcategories, so /categories isn’t really working for me.

currently, my Categories sidebar section starts like this with categories below it:

image

that’s a link to a topic that i described in my previous post.

ideally for me, instead of a sitemap topic, the /categories page could be used if it had some features to present tags as structure. i would be able to present a list of tags inside of each category. preferably, i would have the option to order these lists of tags however i want (fixed order), but an option for ordering based on tag popularity would also be cool. these lists may be multiple rows which may or may not correspond to tag groups, but that would be logical. i.e. each category may be using multiple tag groups with different logical organization. i do not have a mockup of this, but i guess i could try if that’s unclear.

4 Likes

OK, I think I am starting to get a better sense of what you’re trying to do. I don’t immediately have great thoughts about how that might be done in practice, though. If you do end up with something closer to what you want using custom sections or additional customization on top of the sidebar, I’d love to see what you come up with.

I think this other topic about using tag groups may also be of interest to you: In the sidebar, can I list the tags by group?

4 Likes

Yep, that’s the plan. In the first iteration we plan to have the same customizations apply for both anonymous visitors and logged in users with the following minor exceptions:

  • links whose destinations are only visible to logged in users will be omitted for anonymous visitors
  • anonymous visitors will see a short site description, while logged in users will not
6 Likes

I just updated my Discourse today, and my global custom section is visible to anonymous users as well. I could swear that it wasn’t before, is that a new change?

2 Likes

Another minor detail: The mouse pointer over the custom section items’ text is a normal arrow pointer instead of a “grabber” hand like over the rest of the sidebar items. Then the pointer becomes a 4-way move icon over the custom menu icons. That is also the case for anonymous users that don’t have permission to customize it.

3 Likes

hm. yeah, it would be nice to have an option on the custom section editor to hide the section from anon viewers. maybe same for individual links.

i’ll probably add a section hider feature to my script since that’s something i need.

3 Likes

possible now with my script

3 Likes

On desktop it now has a pretty bad experience - click on an element and it will prioritize dragging instead of clicking. This makes me always click many times and cannot enter the correct page

4 Likes

Thanks for this great feature. We’re trying to link to the same category 3 times, but with different filtering/sorting and it’s not working properly.

All links seem to go to the same place and then after clicking on of them, the others cannot be clicked (as if it already thinks you’re in this category).

Links are:

  • /c/ideas-feature-requests/11/l/latest?order=votes
  • /c/ideas-feature-requests/11/l/latest
  • /c/ideas-feature-requests/11/l/latest?state=my_votes
4 Likes

This is an interesting one.

Making this behave as you’d expect is certainly something we want to do, especially as we are also working on more advanced topic filtering (there is work in progress on a yet to be announced experimental feature that adds a /filter route for this).

At the same time, the logic we have for category lists that dynamically change the destination depending on whether you have any new or unread topics may complicate this. We probably need to make that logic more targeted specifically.

@tgxworld and @kris.kotlarek do you think there’s a straightforward fix to make here? Or is it something that you think might take a bit more of a deeper dive to chart out our desired path forward first?

6 Likes

We tuned the timings, how is it feeling now?

5 Likes

Thank you very much for your efforts! Now its adjustment is very smooth

Actually, I’m sorry to say that I recently discovered another bug.

if the link is set to /, clicking it will lead to a completely blank page

image

6 Likes