Topic: How To: add "You are Logged In As" username123" above the...
How To: add "You are Logged In As "username123" in the header template or above the "My Profile" tab on the left user menu--
I am using the SocialType template.
Thanks All.
You are not logged in.
vldPersonals Forum » Customization and Design » How To: add "You are Logged In As" username123" above the...
How To: add "You are Logged In As "username123" in the header template or above the "My Profile" tab on the left user menu--
I am using the SocialType template.
Thanks All.
Edit 'header.tpl' template file. To display username use {session.username} tag.
<!-- IF loggedin == "1" -->
<a href="{virtual_path}account/home/">Welcome {session.username}</a>
<!-- ENDIF -->
WOW!
You guys are awesome!!!
I had to locate and relcoate a few times to get the exact position, but it looks great now.
Just in case someone else wishes to use this for their SocialType - left hand "logged in" member profile menu.
Here it is.
<div id="usernav">
<ul>
<li class="first"><a href="{virtual_path}account/home/">Logged In As: {session.username}</a></li>
<li>{anchor:url1="account/home/",url2="index.php?m=account_home",name="core|usermenu_profile"}</li>
....
</ul>
</div>How would you put an "else" in there, to welcome them as a guest if they are not logged in, like on this site.
Thanks.
<!-- IF loggedin == "1" -->
<a href="{virtual_path}account/home/">Welcome {session.username}</a>
<!-- ELSE -->
<a href="{virtual_path}account/login/">Welcome guest!</a>
<!-- ENDIF -->
Thanks ![]()
Will this work in 2.4.1? And where exactly in header.tpl is the best place to put it? (Thanks
)
<!-- IF loggedin == "1" -->
<a href="{virtual_path}account/home/">Welcome {session.username}</a>
<!-- ELSE -->
<a href="{virtual_path}account/login/">Welcome guest!</a>
<!-- ENDIF -->
I used this code to place a "welcome username" in my main navigation bar. It shows up right next to the hotornot link. I want to move it to the far right so that it is directly over the "log-out" link in the user navigation bar. What code do I use in site.css to move it to the far right?
Thanks
Try this:
<li style="float:right;"><a href="{virtual_path}account/home/" style="text-decoration:none;"> Hello {session.username}</a></li>
Thanks for the quick response. I can't get it to work - probably because I'm unsure about the placement of the code you provided. What code should it follow?
Thanks again and merry Xmas!
Try this:
<li style="float:right;"><a href="{virtual_path}account/home/" style="text-decoration:none;"> Hello {session.username}</a></li>
I'm probably using a different version of vldPersonals than you are but try the following (please backup before making changes).
In your header.tpl find:
<!-- IF loggedin == "0" -->
<li>{anchor:url1="account/register/",url2="index.php?m=account_register",name="core|menu_register",pre="<span>",pro="</span>"}</li>
<!-- ENDIF -->
First thing I would do, is move the above code so it displays your Sign Up link as the last selection in the naviagation menu. Right now it is the 3rd selection.
Look for:
<!-- IF session.can_access_cp -->
<li>{anchor:host=virtual_cp_path,url1="",url2="",name="core|usermenu_cp",pre="<span>",pro="</span>"}</li>
<!-- ENDIF -->
and place the above code after it.
After you moved the above link to the right position, I would change the code to something like:
<!-- IF loggedin == "0" -->
<li>{anchor:url1="account/register/",url2="index.php?m=account_register",name="core|menu_register",pre="<span>",pro="</span>"}</li>
<!-- ELSE -->
<li style="float:right;"><a href="{virtual_path}account/home/" style="text-decoration:none;"> Welcome {session.username}</a></li>
<!-- ENDIF -->
That should work. If it does not work, you may have to ask someone who is using 2.5.5 since I'm still using 2.5.3.
Thank you for your time. I'll give it a try.
Does this work in 2.7 ?