# Discourse Sidebar Blocks

**URL:** https://meta.discourse.org/t/discourse-sidebar-blocks/51457
**Category:** Plugin
**Tags:** deprecated
**Created:** [2016年十月12日 16:13 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457 "2016-10-12T16:13:50Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [2016年十月12日 16:13 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/1 "2016-10-12T16:13:50Z")

</div>

> ⚠ This plugin is now deprecated. Please use the [Right Sidebar Blocks](https://meta.discourse.org/t/right-sidebar-blocks/231067) theme component instead.

This plugin shows a list of blocks as a sidebar on all discovery list pages (latest, new, unread, categories but not on the single topic page). The available blocks at this point (Oct. 12 2016) are the following:

- multiple category posts (6 items max per category)
- latest replies (5 items)
- a custom html block

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 block order` is a list of “tags” that can include category slugs, `latest_replies` for the replies block and `custom_html` for the custom HTML content
- `sidebar custom content` where you can enter arbitrary HTML content to show on the sidebar

The plugins works on desktop only, and there are no plans to add it to the mobile view. You can see a real like site with the plugin at [peshkupauje.com](https://peshkupauje.com) (an Albanian community blog/forum) where it’s working quite well alongside the [Topic List Previews](https://meta.discourse.org/t/topic-list-previews/41630) and the [Links Category](https://meta.discourse.org/t/links-category-for-discourse/43532) plugins.

**Upcoming features**

I would like to add the following features to the plugin:

- auto-refresh content in sidebar blocks, like in main column
- performance improvements

If anybody has any ideas on how to add the auto-refresh feature, please let me know.

Repository: [GitHub - pmusaraj/discourse-sidebar-blocks · GitHub](https://github.com/pmusaraj/discourse-sidebar-blocks)

Screenshots:

 ![](https://global.discourse-cdn.com/meta/original/3X/5/c/5c7ee91c416864d88a5f52d88df1929d4bf79784.png)

 ![](https://global.discourse-cdn.com/meta/original/3X/9/f/9fe2d0905a305f5541316626c23b0475c953465a.png)

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2016年十月12日 20:30 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/2 "2016-10-12T20:30:31Z")

</div>

Cool 🙂

> [@pmusaraj](#):
>
> auto-refresh content in sidebar blocks, like in main column

You need to add a (or use an existing) [messageBus](https://github.com/SamSaffron/message_bus) publication and subscription. E.g.

Publication: [discourse-ratings/plugin.rb at main · paviliondev/discourse-ratings · GitHub](https://github.com/angusmcleod/discourse-ratings/blob/master/plugin.rb#L68)

Subscription: [https://github.com/angusmcleod/discourse-ratings/blob/master/assets/javascripts/discourse/pre-initializers/ratings-edits.js.es6#L36](https://github.com/angusmcleod/discourse-ratings/blob/master/assets/javascripts/discourse/pre-initializers/ratings-edits.js.es6#L36)

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2016年十月12日 20:46 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/3 "2016-10-12T20:46:40Z")

</div>

I’ve been working on a ‘three column’ version of Discourse for my own project for a little while. I’m not quite ready to share it with the world yet, but considering you’re working on something similar, I’ll let you know that I plan to release in plugin form in the nearish future.

 ![](https://global.discourse-cdn.com/meta/original/3X/d/e/deee1816f9809e1eb0404d1ecc477012e06718d4.png)  
 ![](https://global.discourse-cdn.com/meta/original/3X/e/9/e9742bb41e7d4a9d4fc57f8483dc233beee9560d.png)

The relevant part here is contextual ever-present columns. The columns are always there, including in topics (not in the admin panel though). All navigation is moved to a component in one of the columns. The components ‘know’ where they are at all times because I’ve added various route properties to the application controller that get refreshed each time there are any route changes.

This is slightly different from what you’re doing here, however it may have some cross-over.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [2016年十月13日 13:58 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/4 "2016-10-13T13:58:52Z")

</div>

Thanks Angus, I will look into messageBus!

This three-column layout looks interesting, would be happy to test it out once you have it closer to release (or whenever you will be looking for feedback).

---

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [2016年十一月27日 12:57 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/5 "2016-11-27T12:57:38Z")

</div>

sidebar blocks are not working in the latest update. is that the case for you as well?

p.s.: two suggestions regarding Angus design @angus :

- Latest replies of topics can be shown in the excerpt area rather than topic excerpt, so you need less click to get updated.

- the big search box can work for creating topic as well. less click to start a discussion in this social-style homepage.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [2016年十一月27日 17:40 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/6 "2016-11-27T17:40:39Z")

</div>

I just tested it on a local site with current master, and it works for me. Do you have other plugins on your site that may break?

---

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [2016年十一月28日 07:41 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/7 "2016-11-28T07:41:01Z")

</div>

thanks for the confirmation.

cakeday, header search, and of course topic list preview; other than default plugins.

maybe it’s because of the crash we experienced recently, I’ll rebuild the app to see if it becomes ok.

---

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [2016年十一月29日 11:11 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/8 "2016-11-29T11:11:29Z")

</div>

after update to latest discourse and latest sidebar, everything has vanished 😕

I’m not sure if sidebar is working on the latest at all.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [2016年十一月29日 15:12 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/9 "2016-11-29T15:12:05Z")

</div>

And if you remove the plugin and rebuild app, Discourse works well? I will look into this, though locally (dev environment) it works fine.

---

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [2016年十二月2日 09:21 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/10 "2016-12-02T09:21:16Z")

</div>

I explained it bad, I meant in the sidebar.

anyway after [this fix](https://meta.discourse.org/t/dynamic-sidebar-plugin/21678/45) on the dynamic sidebar, the sidebar blocks do not work on our forum ☹

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [2016年十二月2日 14:05 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/11 "2016-12-02T14:05:35Z")

</div>

I’m even more confused now. The link for the fix you added is for a different plugin, the “Dynamic Sidebar” plugin.

I haven’t tested using the “Dynamic Sidebar” plugin with my Sidebar Blocks plugin, it’s very likely they don’t play nice together. And… you shouldn’t use both. If you need to put only HTML in the sidebar, use the Dynamic Sidebar plugin. If you need the blocks, use only the “Discourse Sidebar Blocks” plugin.

---

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [2016年十二月3日 07:12 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/12 "2016-12-03T07:12:55Z")

</div>

you are right, I haven’t got it right and I thought this plugin works alongside dynamic sidebar plugin.

thanks .

---

<div class="post-metadata">

### Author: ![Nam\_Nguyen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nam_nguyen/32/68634_2.png) [@Nam\_Nguyen](https://meta.discourse.org/u/Nam_Nguyen)
#### Post date: [2016年十二月3日 18:44 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/13 "2016-12-03T18:44:05Z")

</div>

Hi pmusaraj,  
I think it will be nice if Dynamic Sidebar can automatically moves the sidebar column down/up when users scroll, and refresh 🙂

---

<div class="post-metadata">

### Author: ![Nick29](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nick29/32/62657_2.png) [@Nick29](https://meta.discourse.org/u/Nick29)
#### Post date: [2017年一月6日 16:18 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/14 "2017-01-06T16:18:51Z")

</div>

Hi @pmusaraj is it possible to customise the css of the sidebar using the discourse customisation panel? I want to have a bit thinner but using the .sidebar selector hasn’t worked for me. thanks

---

<div class="post-metadata">

### Author: ![jgujgu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jgujgu/32/64012_2.png) [@jgujgu](https://meta.discourse.org/u/jgujgu)
#### Post date: [2017年一月8日 01:32 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/15 "2017-01-08T01:32:15Z")

</div>

This is a great plugin. Will it be updated for 1.7+? I don’t think it’s currently compatible.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [2017年一月10日 19:51 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/16 "2017-01-10T19:51:31Z")

</div>

Yeah, it looks like the upgrade to Ember 2.10 broke the plugin. I will look into solutions to fix.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [2017年一月10日 20:39 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/17 "2017-01-10T20:39:10Z")

</div>

@jgujgu the plugin is now compatible with the current version of Discourse (1.8.0.beta1) following this commit:  
[https://github.com/pmusaraj/discourse-sidebar-blocks/commit/5e949db074317616596c8f9332cadcb99b764c66](https://github.com/pmusaraj/discourse-sidebar-blocks/commit/5e949db074317616596c8f9332cadcb99b764c66)  
thanks for the report!

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [2017年一月11日 15:44 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/18 "2017-01-11T15:44:51Z")

</div>

Yes, it’s doable. You may want to use the specific selector in your CSS customizations though:

```
html:not(.mobile-view) .has-sidebar+.sidebar {
    border:1px solid red;
}

```

and don’t forget to also update the width of the main column `html:not(.mobile-view) .list-container.has-sidebar` as well.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [2017年一月13日 15:09 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/19 "2017-01-13T15:09:03Z")

</div>

A few improvements on the plugin:

- Thanks to @jgujgu now the number of posts for each category post on the sidebar is configurable  
[add variable number of results to admin/sidebar by jgujgu · Pull Request #1 · pmusaraj/discourse-sidebar-blocks · GitHub](https://github.com/pmusaraj/discourse-sidebar-blocks/pull/1)
- The replies block is now “live”, meaning that it’s contents updates automatically as new replies are posted on the site

---

<div class="post-metadata">

### Author: ![Nick29](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nick29/32/62657_2.png) [@Nick29](https://meta.discourse.org/u/Nick29)
#### Post date: [2017年一月16日 22:49 UTC](https://meta.discourse.org/t/discourse-sidebar-blocks/51457/20 "2017-01-16T22:49:09Z")

</div>

Does javascript work in the custom\_html field? Having issues trying to get a twitter widget to diplay

[下一頁](https://meta.discourse.org/t/discourse-sidebar-blocks/51457.md?page=2)
