Hi
So I've been doing some pretty custom work for a large project and specifically been using Timo's DNN Framework Attributes Example Skin to help me get by on some of the custom features the site needs... I don't know if this is a skinning question or an administration question, but here goes...
I needed a message at the top of my skin, near the login that welcomed users that weren't logged in, but that showed the user's username if they were logged in. Like so:
- Not logged in: Welcome Guest!
- Logged in: Welcome Display Name! e.g. Welcome Shebang Websites!
So, here's the code (.ASCX skinning) for this:
<p>Welcome <span class="show-username"><%= UserController.GetCurrentUserInfo().Displayname %></span><%=IIf(Request.IsAuthenticated, "", "Guest")%>!</p>
This seems to work and work well... Note, the ".Displayname" call is not listed in Timo's example skin, but does indeed work. Go figure...
But, what I also need though, is for the Register Token, to be displayed as "My Account" and not "Register". This is also fairly simple, using the "text" property for the token:
<ul>
<li><dnn:USER runat="server" id="dnnUSER" cssclass="null-class" text="My Account" /></li>
<li><dnn:LOGIN runat="server" id="dnnLOGIN" cssclass="null-class" text="Login" LogoffText="Logout" /></li>
</ul>
Not quite though, because when logged into the site, "My Account" is substituted with the Display Name, e.g. John Smith. This is not the desired result...
You'll notice on the Login token has properties for "Text" and "LogoffText" - this allows you to customize exactly that. i.e. the text for the Login token when you're logged out as opposed to when you're logged in. BUT, the Register token only seems to allow you to add the logged out text property. I've checked the VB for this skin object, and it appears that the "when-logged-in" text is set as a constant - i.e. cannot be targeted with properties from the skin object injection.
So, my question is an either or one:
How can I set the Register token's / skin object's text to display as "My Account" without changing anything in the core?
OR
Is there a link attribute that I can call that will give me the same linking result as the Register token, in that, when you're not logged in the link directs you to the registration page, but when you are logged in, it takes you to the account manager..? Something like the java-link that is added to the token:
__doPostBack('dnn$dnnUSER$cmdRegister','')
But not the actual javascript function, I'd prefer something like this:
<a href="<%=NavigateUrl(PortalSettings.RegisterTabId)%>">My Account</a>
I haven't tried this myself yet... And again, it needs to give you the same results as the Register token...
I've tried to be as articulate as possible. Shout if there is something you don't understand. Any help and insight would be appreciated... Timo..?
Thanks in advance.
Jon