Sidebar with categories

This plugin shows categories on the page sidebar on all discovery list pages (latest, new, unread but not on the single topic page, and categories).

Screenshot:

Blocks can be ordered in the plugin settings. Speaking of which, there are these settings under Admin > Settings > Plugins:

  • sidebar enable enables the display of the sidebar
  • sidebar custom content where you can enter arbitrary HTML content to show on the sidebar

Repository: GitHub - Toxuru/discourse-sidebar-categories: Plugin for Toxu site sidebar.

To install plugin: Install Plugins in Discourse

The plugins works on desktop only, and there are no plans to add it to the mobile view.

Important note. Despite the clarity, this example adds duplication of categories that already exist elsewhere on this page. Of course, we can hide some navigation elements to avoid duplication, but this will entail even more changes.

I think this could be a good example of using a sidebar. You can clone the plugin and use it for your needs (changing the code for your specific tasks).

21 Likes

The plugin is awesome i been looking for something like this but can you please tell me how i can reduce the space between the Categories and the posts list ?
see the picture below
image

Update: also its showing on mobile breaking tye page

I don’t have the plugin installed, but here are the css lines to edit to adapt the space between the sidebar and the topic list:

.sidebar {
    width: 220px;
}

.container.list-container.has-sidebar {
    width: calc(100% - 221px);
}

You can reduce the size of the sidebar, example:

.sidebar {
    width: 150px;
}

.container.list-container.has-sidebar {
    width: calc(100% - 151px);
}
2 Likes

Do you have any idea about the sidebar beeaking the mobile view ?
See the picture below

1 Like

The css on this plugin is for desktop and mobile. The simpliest solution IMO would be to hide the sidebar completly on mobile.

I think this css on mobile theme should work, but I didn’t try it:

.sidebar {
    display: none;
}

.container.list-container.has-sidebar {
    width: 100%;
}
1 Like

The plugin was not intended to work on the mobile version. This is a bug in the plugin (css) and it will be fixed soon. As a temporary solution, you can do as written @Steven. Thank You.

1 Like

Thanks for this plugin. It’s excellent and helped me de-emphasise categories in the topic listing which I wanted to do.

5 Likes

I can set always show the sidebar on all topics? It’s very beautiful for the user to quickly change other categories.

The number of categories in the sidebar is the same as in the menu in the header of the site.

1

It is determined by the site settings:

header dropdown category count

Switching off and on through setting

sidebar enable
2 Likes

I want it always show in the left bar when users read the topics, so they can easy to change to anothe categories quickly if they want.

How can I do this?

This requires some work, and I do not think that within the framework of this plugin. And that’s why. The fact is that the central page and the page of categories we can easily compress (to find free space) for the sidebar.

Everything changes when we are on the topic page, where in fact we already see 2 columns.

We can find a place for the left column here, but this will have to reduce the width of the topic itself and the right column, which will require large changes. There are a lot of small parts.

In general, for this it is better to do a separate plugin.

2 Likes

today I’ve updated to the new version of discourse, and then install 2 plugins: the “sidebar with categories” and the “topic list preview”. After that, my site running very slowly. I don’t know why.

Try experimenting: turn off one of the above plugins in turn. Perhaps you will find out why this happens looking at the statistics (on the left side of the screen).

2 Likes

Tks so much. The Topic list preview is the reason. I disabled it and then the site is OK.

1 Like

Can I ask something?
I don’t know what is name of this area and how can I add something as Sidebar Category or Google Adsense in this area?

Can you help me?

The fastest way is to make changes to the plugin:

Unfortunately, I don’t know him well.

Perhaps you should write to the category: #marketplace

1 Like

Thank you Evgeny. I’ve already install that plugin and running. But I want to add the Ads script in that area, or add the short-sidebar-category in it, so the user can easy to change the new category if he wants.

1 Like

How can I activate the Sidebar With Categories on the single topic page?

Unfortunately, this is not possible with this plugin. You need to write a new plugin that will make changes to the existing file:

By overriding it. Because I do not see existing ones in it:

plugin-outlet

in the right place for you.

Redefining this file is a thankless task because it will be necessary to constantly monitor changes in the official version.

I do not redefine this file.

Perhaps you should write to the category: #marketplace
I think that someone has a more elegant solution.

4 Likes