DotNetNuke Powered!
          
John Mitchell's (mostly DotNetNuke) Blog - Changing the User SkinObject to Display UserName instead of FirstName LastName in DotNetNuke
 Wednesday, May 10, 2006

Here is an easy way for skin designers to replace the default behaviour of the USER SkinObject without having to modify the core SkinObject.

In your skin find the USER skin object.

In an HTML skin it will be a token that says [USER]

In an ASCX skin it will be code that looks like <dnn:USER runat="server" id="dnnUSER" />

Replace that with the code below:

<a class="SkinObject" href='<%= DotNetNuke.Common.Globals.NavigateUrl("Register")%>'>
<%=IIf(Request.IsAuthenticated,HttpContext.Current.User.Identity.Name,"Register")%></a>

This is just a quick and dirty way to change the default behaviour in a single skin and does not allow you to have localization built in like you can with the default User SkinObject, but if you wanted to localize it to a different language you would just need to change that last part of the code where the word is "Register" to your own word.

Here is the same code with the text in Italiano:

<a class="SkinObject" href='<%= DotNetNuke.Common.Globals.NavigateUrl("Register")%>'>
<%=IIf(Request.IsAuthenticated,HttpContext.Current.User.Identity.Name,"Registro")%></a>

5/10/2006 9:22:16 AM (Central Standard Time, UTC-06:00)  #    Comments [0]