cancel
Showing results for 
Search instead for 
Did you mean: 

Display User Name in custom ajax masthead

SandipAgarwalla
Active Contributor
0 Kudos

Dear all

I am currently modifying the standard ajax masthead to display the user name in line with the logo on the masthead itself, and plan to hide the menu bar

e.g.

For the User Name, I modified the Masthead.jsp


<%if (mastHeadBean.isShowLoggedAsMessage()) {%>

  <td>

                 <div class="userWelcome_container" id="welcome_message_container">

                

              <% if (mastHeadBean.isPreview()) { %>

         <%= (mastHeadBean.getWelcomeMsgTitle()) %>

              <% } %>

    </div>

             </td>

            <%}%>

But it does not display correctly and the last name.  If  you see below image, the user name is coming in a span which I do not want.

I would like to display user, then help, then log off

Any help is appreciated.

Thanks

Sandip

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Sandip,

Just add styling to this, make the line-height 100% and use vertical-align: middle.

This will center your text vertically.

BR,

Saar

SandipAgarwalla
Active Contributor
0 Kudos

Thanks Saar

This is what I could get

I tried aligning the user name, but didnt work.

<%if (mastHeadBean.isShowLoggedAsMessage()) {%>

  <td nowrap="nowrap" class="hyperlink_container" id="userWelcome_container">             

                  <span id="user_welcome_span" class="hyperlink_divider" style="vertical-align:middle">

                  <%= (mastHeadBean.getWelcomeMsgTitle()) %>

  </span>

             </td>

            <%}%>

Also how do I change  the style for Help & Logoff. I changed them in Theme but does not reflect at runtime.

Thanks

Sandip

rohit_singhal
Active Contributor
0 Kudos

Hi Sandip,

Could you try applying negative margin-top and/or negative padding-top.

This should align your Welcome message with the other links.

Also to change the style for Help and Logoff can you check if these elements have any class/id assigned to them.

If yes, you can apply styling to them as well.

Best Regards,

Rohit Singhal

SandipAgarwalla
Active Contributor
0 Kudos

I applied negative margin and the styles to the font but it does not seem to be reflecting

<td nowrap="nowrap" class="hyperlink_container" id="userWelcome_container">
<span id="user_welcome_span" class="hyperlink_divider" style="vertical-align:middle;padding-top:0px;">
<%= (mastHeadBean.getWelcomeMsgTitle()) %>
</span>

</td>

Also for Help & Logoff,

<td nowrap="nowrap" class="hyperlink_container" id="userWelcome_container">
<span id="user_welcome_span" class="hyperlink_divider" style="vertical-align:middle;padding-top:0px;">
<%= (mastHeadBean.getWelcomeMsgTitle()) %>
</span>

</td>

Thanks

Sandip

rohit_singhal
Active Contributor
0 Kudos

Hi Sandip,

For the welcome message, I think you might have to try a combination of both padding-top: -2px, and margin-top: -2px. This should push the welcome message in line with the other links.

For Help and Logoff, you can include a css at the beginning of your Masthead.jsp, place the css in KM, and you can style the classes in the CSS.

I tried the first approach at runtime for the standard AFP Masthead using developer tools, and was able to accordingly move the text as required.

Please let me know if the above approach works for you.

Best Regards,

Rohit Singhal