Show "Upcoming Events" in all categories

Hi everyone!, I have a small issue that I can’t seem to resolve. I have a forum (laguaridaretro.com) where, thanks to the “Right Sidebar Blocks” component, I can customize the right column of the forum. The thing is, I have the upcoming events displayed there, as you can see in the screenshot below. These events appear on the forum’s homepage and in the Events category, but when I enter another category on the forum, it simply shows up empty, as if no events were published.

I would like all events to appear in all categories, not just those two. Is that possible?

The calendar shows but no events are listed or the whole thing is gone?

I’m guessing you have configured which pages the calendar shows in the administration interface like so:

By default, the event list only returns the events for the current category. There is a value transformer (discourse-calendar-upcoming-events-show-cross-category) that you can use to change that.

You create a new theme component (I think it’s better when it’s loaded early, so use something like “aaa all events in each category” for the name).

In the JS tab, add this:

api.registerValueTransformer(
   "discourse-calendar-upcoming-events-show-cross-category",
   () => true
 );

So it looks like this:

Then save the code, and after a reload, you should be able to see all events in each category.

Screenshots from my testing:
The documentation category with all 3 events


And the same events also visible in the Test 3 category

That was it! Many thanks from the bottom of my heart, I can now see the events in all categories :smiley:

Why don’t we look to add that as a feature/parameter for the existing Upcoming Events block?

I thought it might be confusing, because this has global consequences. I am not sure everyone would immediately understand that changing the parameter for the event list in the right sidebar blocks will also affect event lists outside of the theme component. That’s why I would keep it separate.

Interesting! I hadn’t appreciated it would do that either. Of note, it shows events in Messages in the calendar too. For me this is a major bonus, and I prefer this to the default behaviour.

I also hide the calendar in Events categories already as I find it pretty messy / ugly; having the right sidebar block active in these is much nicer.