Skip to main content
security_lion
Helper ⭐️⭐️
Dec 19, 2022 7:49 PM UTC

Custom search banner to say Welcome @username or @first name

Has anyone created a script or snippet of code to customize their search banner?

I’d like to do something that says Welcome @First Name or Welcome @username and it pulls the first name or user name from their registration information.

2 replies

bas
Helper ⭐️⭐️⭐️
Dec 20, 2022 9:55 AM UTC

Yeah, you could do that :)

Just tried it on my “artful community” demo sandbox

Code is fairly straightforward:

<script>
  var element = document.querySelector("body.qa-forum-site-index h1.brand-hero-title");
  var username = inSidedData.user.name;
  if (username !== "guest") {
      element.innerHTML = "Welcome " + username;
  }
</script>

Translate
security_lion
Helper ⭐️⭐️
Dec 20, 2022 5:12 PM UTC

Thank you so much @bas , really appreciate it!

Translate