Forum Discussion

vishwajit_shind's avatar
10 years ago

To hide the default user name appearing in browser tab of view profile page.

Hi, 

Can any one suggest me how i can hide the default user name which appears in browser tab while loading view profile page. 

Please find the screen shot "actual_behaviour.png" for more details. 

We want to change the default username in the tab. 

Thanks & Regards, 
Vishwajit


actual_behaviour.png

8 Replies

  • OlivierS's avatar
    OlivierS
    Lithium Alumni (Retired)
    10 years ago

    vishwajit_shind to be more precise (and it's not specific to Lithium), the web browser tabs display what's in the HTML TITLE code. As for your question, I'm not sure you can modify it. To me, I would say it's hard coded (the username bit). Is there any reason why you want to change it?

     

    2015-03-25_0821.png

  • vishwajit_shind's avatar
    vishwajit_shind
    Expert
    10 years ago

    Hi OlivierS,

     

    Thank you for your update.

     

    We are using javascript to change the all default username in the community to the first name and last name first capital letter. But somehow we were not able to hide the default username appears in the browser tab while view profile page is getting loaded.

     

    Please find the screen shot for more details.

    Thank you.

     

    Regards,

    Vishwajit


    expected_behavior.png
  • nathan's avatar
    nathan
    Executive
    10 years ago

    Lithium uses the user's login (username) all over the place - and this is just one example. The reason you see the login name in the browser tab is because it is included in the page's <title> tag.

     

    I'm pretty sure you won't be able to change the initial content of the <title> tag with any out of the box customisations, so your only option at the moment is to use JavaScript, and execute it as early as possible (which means putting it in the 'Page Head Content' part of the skin wrapper).

     

    Lithium professional services may have the ability to change the default title though.

  • ChiaraS's avatar
    ChiaraS
    Lithium Alumni (Retired)
    10 years ago

    Hi,

     

    it's possible to change the page head title string via the Text Editor in Studio (see http://community.lithium.com/t5/Pages-and-layouts/Change-a-page-title/ta-p/72218 for more details).

     

    You can customize that just for the ProfilePage if needed, you can add something like this:

    page.head.title@page:ViewProfilePage = {0} User Profile Page {2}

    or 

    page.head.title@page:ViewProfilePage = User Profile Page

     

    Unfortunately it's not possible to pass additional variables there, so it will not be possible to add the first and last name with this approach. But if you have a title that works for all users, that would be ok.

  • luk's avatar
    luk
    Boss
    10 months ago

    manasab 's answer is the way to go, use the FreeMarker page.content.head.setTitle() method, this will do what you want and you can set whatever you want as the title.