Skip to main content
Best Answer

Is there a way to add the user's first name to text in html widget

  • 2 July 2024
  • 1 reply
  • 61 views

I would love to bring the user’s first name into an html widget. Anyone know how (assuming it’s even possible)?

1 reply

Userlevel 6
Badge +2

Unfortunately this isn’t possible using the HTML widget as we don’t have access to variables from other areas of the platform. However, using the My profile widget, it’s possible to get the user’s full name (no way that I know of to just get first name unless their user profile is missing a last name value).

Using the my profile widget you can hide everything else and make something like a welcome message that could look like this:

 

 

Here’s the CSS to recreate this look:

/*My Profile Welcome Message*/
myprofile-widget .wrapper-shadow {
box-shadow: none !important;
border: none !important;
background-color: transparent !important;
}
myprofile-widget .fullName::before {
content: "Welcome, ";
}
myprofile-widget .profile {
padding: 20px 0px !important;
background: none !important;
}
myprofile-widget .avatar__initials, myprofile-widget .email, myprofile-widget .widget-actions-container, myprofile-widget .avatar-container{
display: none;
}

myprofile-widget .cover {
background-color: transparent !important;
}
myprofile-widget .details-container {
color: #343A40 !important;
font-size: 1.5em !important;
}

 

 

Alternatively, some people opt to add text around the Name portion of the standard profile widget like this:

Here’s the CSS for that:

/*Customize welcome text on My profile Widget*/
.fullName::before {
content: "Hello ";
}

.fullName::after {
content: "! Welcome to the Docebo Academy! On the right side of this page, you'll find a learning plan to help you master the Docebo Platform. Be sure to check out the Learner Menu in the top left for more resources!";
}

 

Reply