Skip to main content

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

  • December 19, 2022
  • 2 replies
  • 58 views

security_lion

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
Forum|alt.badge.img+1
  • Helper ⭐️⭐️⭐️
  • December 20, 2022

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>


security_lion
  • Author
  • Helper ⭐️⭐️
  • December 20, 2022

Thank you so much @bas , really appreciate it!