How can I mask the ID?

When I read a post, I would like to show it by masking the writer ID.

Like this. abcdef -> abcd**

How can I mask the ID?

1 Like

You can hide the username with CSS

1 Like

Maybe try with css

.second.username>a {
    position: relative;
}

.second.username>a:after {
    content: '***';
    position: absolute;
    right: 0;
    background-color: #fff;
}
3 Likes

For what prupose? The CSS solutions will expose the full ID to the public, so keep that in mind. :slight_smile:

1 Like

for the purpose of protecting personal information.

If by id you mean username:
image

This is widely used by Discourse. You can mention people with it @sungjun_hwang, use it in the search etc. Plus it’s nothing more than a username, not a real name.
There is a real name field though:
image
This one can be hidden from Discourse admin settings.

What is the purpose of your request? Do you want to provide anonymity for your users or something like this?

image
I mean username. some username is phone number so i want masking it.

Thank you. Which CSS file should I add?

Discourse makes much use of usernames and I don’t think you can make this data private.
If you hide it with css, the username will still appear in the html code and also in a lot of requests results.

In my opinion you should fix the issue at the source : why are your usernames phones numbers? :face_with_raised_eyebrow:

2 Likes

This is a simple example, but there are more ways. If the username is a phone number, you can use the invitation effect or click to view. Discourse Spoiler Alert

.topic-meta-data .username>a {
    position: relative;
}

.topic-meta-data .username>a:after {
    content: '***';
    position: absolute;
    right: 0;
    background-color: #fff;
}
1 Like

It work! Thanks! :grinning:

1 Like

Note that every profile path will also include the Username in the URL.

3 Likes