How to enable bulk selection for theme?

Hi there, I’m using Sam's Simple Theme but it doesn’t enable bulk selection. More precisely, the selection boxes appear but not the actions menu.

When I revert to the default Discourse theme it works as expected.

I tried adding a theme component with the CSS that I could find for the bulk selection, but it makes no difference.

.topic-list .topic-list-data.bulk-select {
  padding: 0;
  width: 30px;
}
.bulk-select-topics {
  display: inline-flex;
}

Is there any way I could add in this functionality? Thanks a lot.

2 Likes

Can you reproduce here on meta with Sam’s Simple Theme? I just tried, and I see the button:

2 Likes

Thanks for the reply. I don’t have moderator permissions here on Meta so no bulk selection.

1 Like

As non-moderator, you should see the Dismiss button:

1 Like

Ah OK, yes, that works for me both here and on my forum. But the bulk actions menu for moderators is a separate dropdown menu that appears with more options, that’s what I’m missing.

2 Likes

please make sure both the theme component and Discourse instance are up-to-date. that functionality was added.

2 Likes

Hi there, yes they are both up to date.

1 Like

is this the menu you are referring to?

That is a mod on my test forum running Sam’s simple theme that I just updated.

2 Likes

Hmm weird. Since I started using it a few years ago bulk selection actions never appeared with Sam’s Simple Theme. While working on some other theme component a year or so ago I did run across a code snippet that made it start working, but I either removed it by accident or it stopped working with an update.

The only possible difference I can think of is that I’m on the stable branch, but like I said this has been a long-standing issue for years for me.

2 Likes

yea this is likely why. I think the new bulk actions menu was only recently added to that theme.

if you look at your forum as an admin with that theme, or in safe-mode as a mod, do you see the proper bulk actions menu?

3 Likes

With ?safe_mode=no_plugins no, the menu doesn’t appear. With ?safe_mode=no_themes%2Cno_plugins it does work but that’s obviously just because it disables 3rd party themes.

I downloaded the main branch from GitHub - discourse/discourse-simple-theme: Sam's simple discourse theme and a quick search for bulk in all the files doesn’t find anything.

1 Like

no it’s not there, but it needed to be compatible. you can see the old bulk select stuff removed here when templates were refactored:

2 Likes

So if I understand correctly, the old version of Sam’s Simple Theme had handling for bulk selection, and then Discourse changed the way it worked, and then Sam’s Simple Theme recently had that old handling removed and now it’s undefined in Sam’s Simple Theme so that it works by falling back to the core bulk selection code?

1 Like

So I guess what I don’t understand is that bulk selection never worked for me with Sam’s Simple Theme until I added a few lines of code a year or so ago, I can’t remember if it was CSS or JS in the HEAD.

1 Like