The discussion revolves around implementing a different theme for personal message topics list in a Discourse forum. rahim123 wants to use Sam’s Simple Theme, which is preferred by their community, but has limitations for the personal messages topics list.
Don suggests overriding the theme using a custom template with {{#if topic.isPrivateMessage}} to change the pm topic list items. rahim123 successfully uses this approach but encounters issues with the topic list header.
A Arkshine suggests using CSS to solve the issue and provides a code snippet. However, rahim123 faces difficulties in implementing the solution due to other customizations in their components.
It is later discovered that the issue is due to the use of an older version of Firefox (115 ESR) which does not support the :has selector used in the CSS solution. Don points out that the :has selector is only supported from Firefox 121.
A Arkshine provides an additional CSS solution to improve the layout for narrower windows by hiding the Replies column and the avatar in the Last Post column. After some fine-tuning, the solution works as desired.
rahim123 expresses gratitude towards Arkshine for their help in resolving the issue.
Hi, is there any way to use a different theme just for the personal messages topics list? I am currently using Sam’s Sam's Simple Theme which I and my community strongly prefer for the /latest list, since it prints out the OP and most recent poster usernames in text, and it eliminates the clutter of the list of the frequent posters avatars that nobody cares about. Unfortunately that same paradigm falls apart for the /my/messages list, especially when the creator of the PM topic is the same as the most recent poster:
So in the case of /my/messages ideally I would like to just inject the td.posters.topic-list-data column from the default Discourse theme into this view. But if that’s too much work it would be nice to have the option to somehow switch to the default Discourse theme for the PM view.
There are other custom themes that have this same issue such as Kris’s Minima Theme .
It can be possible with override the theme so you have to forked it first or create a request to the theme. In the custom template you can use the following to change only the pm topic list items.
It looks like the #if topic.isPrivateMessage statement doesn’t work for the topic-list-header, so I have the PM participants’ avatars showing as expected, but the headers are missing a <td> so everything is offset.
If anybody has any tips for implementing the logic in the handlebars override I would still prefer that, rather then wasting CPU cycles generating the posters.topic-list-data and then hiding it.
Hi there, thanks a lot, that’s a very good idea. Something didn’t work with the CSS as suggested as it still shows the empty Participants column in /latest, but my original CSS does seem to work fine to hide it only there:
Thanks again for the help. It’s behaving the same way, there is a Participants column header in /latest which makes the columns misaligned with the topic list columns. I must have some other customizations in other components that are conflicting.
Are there any potential problems or disadvantages with this CSS solution?
That would explain it! And it was working in Chromium, but I assumed that was because I wasn’t logged in there as the administrator. I’m using Firefox 115 ESR from Debian 12. Thanks so much, I was going crazy with that.
Oh really. I did not know, and it’s pretty disappointing to be honest . I will definitively test more often on Firefox next time. Thanks for the feedback!
There’s an additional CSS improvement that I’d like to implement to make this more useful: On wider browser windows it now shows the PM participants as expected:
But on narrower windows it reduces the number of participant avatars to only one, so we end up with the same problem as described in the first post of this topic:
Is there a way to fix this via CSS so that on narrower windows it hides the Replies column and hides the avatar in the Last Post column, thus leaving more space for the Participants column?
Thank you! Almost perfect, except that with widths between about 1380px - 1020px it still shows all the columns and reduces the participant avatars to just one. More narrow than that does work great.
Replace medium with extra-large in breakpoint(). It should now start from <= 1140px. The original behavior that hides the participant’s avatars happens at this breakpoint, actually. Does it work?