Is there any way to insert a line of text below usernames? Ideally, I’d like this to appear under everyone’s username.

The CSS I used to achieve this is:
.username::after {
content: 'website.com';
font-size: 14px;
}
But obviously I’d like for it to appear below. Thanks!
إعجاب واحد (1)
Alteras
(Steven Chang)
2
Would this work for you?
.topic-meta-data .names {
flex-wrap: wrap;
}
.names::after {
display: block;
content: "hello world";
font-size: 14px;
width: 100%;
flex: 1 0 100%;
order: 4;
}
edit: added order
property for mobile
3 إعجابات
Thank you! It works perfectly on Desktop, but for whatever reason it shows above the username on mobile.
Alteras
(Steven Chang)
4
Oh. Interesting. they have an additional order
property on mobile.
You can add order: 4
to the after pseudo element and it should fix it.
إعجاب واحد (1)
You could achieve this with Group Default Titles.
Groups can have Default titles which appear by the username.
That way you can have a different one for each Group.
You could style those with CSS to appear underneath if you so chose.
إعجابَين (2)
Works perfectly, thank you!
You could also use the API if you need to adjust the content programmatically (to check the user, the post, etc.).
For example:
api.decorateWidget("poster-name:after", (dec) => {
// "dec.attrs" to access the attributes of the post
return dec.h("div", "meta.discourse.org");
});
.topic-meta-data .trigger-user-card {
flex-direction: column;
align-items: flex-start;
}

إعجابَين (2)
system
(system)
تم إغلاقه في
8
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.