Discourse Sidebar Blocks

I am not sure, but it probably shouldn’t work. You should include javascript via a plugin or a customization (maybe?).

1 Like

At a certain point, I may try to move the plugin into a connector. Currently the plugin overrides the entire discovery template.

https://github.com/pmusaraj/discourse-sidebar-blocks/blob/master/assets/javascripts/discourse/templates/discovery.hbs#L38

@pmusaraj Is this because it needs access to many high-level variables and methods? I ran into some problems trying to create a plugin recently because I could not access some specific controller methods.

I would prefer to have it use an outlet as well, but it seemed tricky to do properly at the time I wrote the plugin. But, please, if you find a way, By all means.

1 Like

Great job @pmusaraj,

Is it possible to activate it only on certain page (e.g : only on homepage, but not on other topic lists) ?

1 Like

Currently, no, it shows up on all “discovery” pages, which means all lists, basically.

And is it a hard work to do it ?
Can i hire you for this job ?

It’s not too hard to do, the Topic Previews plugin has something similar. We could adopt the same settings for the sidebar. Does what Topic Previews does fit with what you need?

I already use topic preview, to show like on topic list.
And i use your plugin to show category on the right. But would love to see it on topic page too.

My official website : https://www.hexanews.com/

And the maintenance one, with your plugin : http://46.101.132.46/

1 Like

So, you want to show a sidebar on an individual topic page? What would happen to the topic timeline that’s by default on the right of the topic page?

Yes,

i already hided the topic timeline on hexanews.com.

Right, but if I include a way to show the sidebar on the topic page, I need to handle the timeline as well. Will think about this a little bit and get back to you.

2 Likes

yes sure ! :wink:
__

hello I would like to change the contents of here, how can i do it?


You can find that strin under Settings > Customize > Text (or something similar) andlook for the string you are trying to replace.

2 Likes

i’m truly grateful for your help :+1:

I use the official version of the discourse 1.7.7, I can not use this Discourse Sidebar Blocks plugin,Request test, thank you very much!

I don’t have the capacity to test with 1.7.7 right now, but the plugin works well on my site, which is running on the latest 1.8.0 beta (I updated the site on Apr 8).

2 Likes

Here is how you can disable the sidebar for certain categories

body[class*="category-blog"] .sidebar {
    display: none;
    visibility: hidden;
}
1 Like

Yes, the above should work, although you would also need to reset the styling applied to the main column, something like this:

body[class*="category-blog"] .list-container.has-sidebar {
    float: none;
    width: 100%;
}

Seems to conflict with the Top Lists Preview plugin: https://meta.discourse.org/t/topic-list-previews/41630

Looks fine in a different category: