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

  • 19 December 2022
  • 2 replies
  • 46 views

Userlevel 1

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

Badge +1

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>

Userlevel 1

Thank you so much @bas , really appreciate it!

Reply