Formerly “Discourse Category Sidebars” — the name of this theme component has been updated to Topic List Sidebars now that it supports both categories and tags.
Summary
Topic List Sidebars takes a topic and applies it as a sidebar for a category or tag’s topic list.
This theme component takes a topic and applies it as a sidebar for a category or tag’s topic list. These sidebars are only visible when the browser is 767px or wider (most tablets and monitors).
Choose a topic and display its content as a sidebar for a category or tag.
Set a sidebar to be displayed on the /latest, /new, /unread, and /top pages by using all as the category name in your settings.
Choose for the sidebars to appear on the left or the right of the topic list.
By default a category’s sidebar will also display for all its subcategories unless a subcategory has its own sidebar defined (you can disable this by unchecking the inherit parent sidebar setting).
How do I configure it?
Choose your categories and tags, and add the id of the topic (e.g. example.com/t/example-topic/57) that you would like to use to populate the sidebar’s content
I recommend creating sidebar topics in their respective categories/tags, closing the topic so there are no replies, and unlisting it (so it doesn’t appear in the topic list).
Note that you cannot use a topic in a private category as a sidebar in a public category (you can technically, but users without access to that private topic will just see a empty sidebar!).
Settings
Name
Description
sidebars
Add and remove sidebars
sidebar side
Choose from Left or Right
inherit parent sidebar
If checked subcategories will inherit their parent category’s sidebar (unless the subcategory has its own sidebar assigned).
When unchecked subcategories will only display a sidebar if one is specified.
stick on scroll
When checked sidebar has a sticky position on scroll
Developer Notes
Each category sidebar is wrapped with a class that contains the category slug, so for the staff category that would be .category-sidebar-staff. You can use these classes to style the individual sidebars.
The body tag on pages with sidebars also has a class added so you can use body.custom-sidebar to apply styles on all pages that have a sidebar.
Credits
Special thanks to @xrav3nz for laying the groundwork to make this component possible!
Hosted by us? Theme components are available to use on our Standard, Business, and Enterprise plans.
Since I am using the header submenu plugin, A part of the text is covered by my header bar. It would be great if it was possible to add extra margin/offset or whatever it’s called for the case when additional elements before the header are covering the sidebar’s content.
Also: is there any way to keep the category drop down menu above the sticky sidebar’s content? that would make it easy for users to jump between categories quickly.
altogether I think the category sidebar is a great plugin and has huge potential to add useful information to the forum structure!
I have a few questions/suggestions that I hope you can help with…
1 - Is it possible to make this so that when a user browses the forum, going from page to page the sidebar always checks for the latest version of the post that it contains? At the moment I think the content of the sidebar only updates on a page refresh? Unfortunately content that rarely changes begins to appear stale to users (particularly active users) and so I’d like to update the topic associated with the sidebar frequently if I can. (Similarly, if the ID of the topic in the options for that page is changed, it would pick it up on the next page-view). I’m quite happy for the additional load per page/view but if you’re worried others may not be perhaps you could add a “cache post contents” option which would make it work like it does now.
2 - Is it possible to associate/pick up content from more than one topic per sidebar please? So for example on the Latests page you might want the content from topics 33,55 (and in that order). This would be great to allow different content per page while also include common info/links that you might want to appear at the bottom of every sidebar.
3 - Is it possible to expand the plugin so it can be used site-wide please? At the moment I think it can only be used on certain pages? Ideally I’d like to use this across the whole forum on all main sections/pages. (Perhaps your tags sidebar plugin could be used in conjunction with this for finer control - eg for individual tags and/or Topics - I think both combined could become a very power sidebar package!!)
4 - Is it possible to add a sidebar width option as well as a configurable cut-off/display-none point please? This isn’t a biggie as it can be done via css changes but think it would be nice to have in the options.
5 - Last but not least… could you get polls to work please? I think allowing users to vote in polls right out of the sidebar would be awesome!!! I find dynamic content like this in sidebars can make them interesting to users, and so less likely that they’ll automatically ignore them.
I think with all the above this plugin would make a very good candidate to be included in core or an official DC plugin - imo it could help people put an individual stamp on their forums and I’m sure people would use them in fun and interesting ways!
Per caso è possibile anche per i gruppi? Avere una barra laterale per i gruppi sarebbe fantastico per fornire informazioni sul gruppo.
Qualcuno può indirizzarmi su come ottenere i parametri del gruppo (far sapere al componente che ci si trova all’interno di un gruppo) in modo da poterci provare e creare un PR da solo?
Potrebbe essere un po’ audace chiederlo, dato che si chiama sidebar, ma: sarebbe possibile aggiungere un’opzione per posizionare il contenuto non a lato, ma sempre sopra l’elenco degli argomenti?
Utilizziamo Discourse come intranet sociale e per alcune categorie abbiamo la necessità di un’area ben mantenibile per link, elenchi di persone, ecc. - questo meccanismo sarebbe ottimo per questo scopo, ma c’è semplicemente troppo poco spazio nella barra laterale.
Sono benvenuti anche gli hack CSS.
Ho già provato i banner di categoria, ma sono limitati al primo paragrafo, quindi questa non è un’opzione.
Mi stavo chiedendo se questo potesse essere modificato o avere un’opzione per spostarlo da una barra laterale a una barra superiore sotto l’intestazione del sito o magari appena sotto il logo di una categoria?
Oppure se potessi ricevere indicazioni su come aggiungere CSS personalizzato per spostarlo e anche farlo visualizzare per dispositivi mobili come una barra superiore appiccicosa? ancorata appena sotto la barra principale del sito?
Potrei fraintendere come funziona questo componente del tema, ma potrebbe essere utilizzato per mostrare l’elenco degli argomenti a sinistra, fare clic su un argomento nell’elenco e visualizzare i post sulla destra (mantenendo l’elenco degli argomenti bloccato a sinistra)? Non ho bisogno di vedere le categorie. Sembrerebbe Flarum.
No, ciò che fa questo componente è prelevare il contenuto da un argomento e utilizzarlo per popolare una barra laterale per l’elenco degli argomenti di una categoria specifica. Non è visibile quando si naviga in un argomento.
Le impostazioni esistenti dovrebbero migrare automaticamente all’aggiornamento… a meno che il tuo slug sia diverso dal nome della categoria, nel qual caso dovrai aggiornare manualmente le impostazioni.
Ad esempio, site-feedback migrerà correttamente a Site Feedback, ma non esiste un metodo per migrare slug che non corrispondono ai nomi (ad esempio, il tuo slug per Site Feedback è hamburgers invece di site-feedback).
Probabilmente cambierò il nome di questo componente tematico e deprecerò le barre laterali dei tag per riflettere la nuova situazione.