Change the variable linked to the "Welcome back" message

Hello,

I’m new to this community and I’ve just installed a Discourse server.
I’m currently trying to modify the “Welcome back, USER!” message that appears when you arrive on the site and when you’re logged in.

So I went into the texts and I found the " js.welcome_banner.header.logged_in_members"

My problem is that the interpolation key “preferred_display_name” seems to be the only key available for this field.
I have found absolutely no reference to this key in the Discourse documentation and if I try to put something else, like “username” or “name”, when saving, I get a message saying that the key is invalid.

What to do?
Thank you

1 Like

Welcome to Meta :waving_hand:

You cannot use keys in texts that aren’t provided by the code. Sometimes you can see a list of available keys, but usually only the ones the text uses are available.
Why do you want to use username or name instead? The preferred display name will be replaced by one of them depending on your site’s configuration.
If you have enabled display_name_on_posts and disabled prioritize_username_in_ux, the banner will use the name. Otherwise it will use the username.

You could start a topic in Feature about adding name and username keys so the admin has a chance to decide independently from the settings.

2 Likes

Indeed, by enabling/disabling these 2 options, it meets my request.
Thank you

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.