You can also use other Ember components as blocks, you just need to use the correct name. For example, core includes a signup-cta Ember component, and you can use it in the sidebar as is. Note that you can’t use components that expect a set of parameters, but you can build your own Ember component in a separate theme and reference it just by its name in the sidebar’s blocks setting.
You can control some features for the provided blocks via parameters.
limits number of results
all except custom-html
limits length of each reply excerpt
contents to display
only shows in category X
list of excluded tags
list of categories to show the widget
blocks: choose the blocks to display and adjust their ordering
show_in_routes: decide on which topic list routes to display the sidebar. By default, it will show it on all discovery routes except for /categories.
Great to see this as an #official Theme Component! It certainly opens up a new world of customisations.
I’ve got 2 questions:
In the sidebar, I want to display the /latest topic list similar to the way that category-topics displays them. Is this possible? recent-replies almost gets there (especially if the excerpt is hidden), but I really want to include topics without replies.
Is it possible to only display the sideblocks in certain categories? What I mean is that the only route displayed is the Category Topic List, and only for the categories I specify.
Apologies, the documentation for this is lacking (I will update it now). The name of the param for custom-html is content.
We don’t have anything ready-made for the full /latest list, but you build your own and add it to the configuration using its name. Should be very similar to the category/tag lists, just without a filter.
Currently, no, you can’t show it on specific categories only. You can however use discovery.category in the show in routes setting, that will only show the sidebar on category routes (but on all of them, not a subset).
Just noted a limitation of the component, especially when it comes the category-topics & subcategory-list blocks, and that is adding multiple blocks of either of these types with different id always resulted in them surfacing topics/subcategories of the uppermost block in the launch editor (I assume).
One bug I’m having right now is after playing around with the subcategory-list block for around 10-12 times, it stop showing altogether on our staging site (see video below).
The subcategory-list block does not take a parameter at all. When used, it will show the subcategories of the current category based on which current category you have navigated to… so it doesn’t make sense to use that block more than once.
That is also why the subcategory-list isn’t showing in your video. If you’re on a non-category route, that block does not show.
For category-topics, in your video I see the same ID used twice: 7. I did a local test and with different IDs I get different topics displayed (i.e. I can’t reproduce the reported bug).
Currently, no, this option does not exist. It makes sense to add it, although, I would imagine that it should support multiple IDs so you can show the block for a list of categories (A, B and C, for example). I am happy to review PRs on the repo, if your developers think they can add this, that would be great. (Otherwise, I can add it to a list of nice-to-haves in the theme component.)
Do you mean a) to fetch the results and cache them for a week or b) to fetch the top contributors for the last week on every load? The latter should be easy to add, caching is a little trickier.
I’m not sure where to find the code for that - would you mind directing me? I’d like to look at modifying the category-topics so that having no ID gives you all categories (and thus effectively the /latest list)