The discussion revolves around modifying the user list display in a Discourse topic. The original poster, sulliops, wants to show only two users: the original poster and the most recent poster, without displaying frequent posters.
Initially, codinghorror provided CSS code that hides all avatars and then displays the first and last ones. However, this solution does not meet the desired outcome, as it prioritizes the first and last avatars regardless of their roles in the conversation.
sulliops pointed out that when the original poster replies, the second user in the list becomes a frequent poster, which is not the intended behavior.
A revised solution was proposed by sam, who suggested using .latest instead of :last-of-type to target the latest poster’s avatar. The revised CSS code is:
/* hide all avatars */
.topic-list .posters a {
display: none;
}
/* display first avatar in list */
.topic-list .posters a:first-of-type {
display: inherit;
}
/* display avatar of latest */
.topic-list .posters .latest {
display: inherit;
}
I have my production version of Discourse running on discourse.sulliops.co, but I want to keep the list of users in a topic from being any more than two.
On my forum (and the Meta), the Users list is shown like the screenshot below, with the original poster, frequent posters, and most recent poster.
I want it to look like below, with the original poster, and the most recent poster.
If this is a JS hack, please also include instructions on how to edit this, because I know nothing about doing so. If it’s a setting, I’m blind so feel free to let me know
AFAIK, support for the CSS pseudo “not” is still poor.
Try targeting all 5 avatars and display: none them.
Follow that with CSS that targets the avatars you want to display only those.
/* hide all avatars */
.topic-list .posters a {
display: none;
}
/* display first avatar in list */
.topic-list .posters a:first-of-type {
display: inherit;
}
/* display last avatar in list */
.topic-list .posters a:last-of-type {
display: inherit;
}
Regarding this, the code you gave me made it so that only two users are shown, but I want it so that first is the original poster, and last is the most recent poster, none of this “frequent poster” stuff. At first it seemed like it was fine, but now if the original poster replies, the second user in the list becomes a frequent poster.
What does this tell you though? When I hover over the system icon it shows, “Original Poster, Most Recent Poster.” Then my icon shows “Frequent Poster” when I hover over it.