Sign In  |  Register
 
 DotNetNuke Powered!
DotNetNuke Support Forums

DotNetNuke Tokens: Some tricks for getting more than SkinPath in your skin.

Rate this topic:

Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.

Page 3 of 4<< < 1234 > >>
AuthorMessages
John Mitchell
Posts:3033



12/07/2007 1:20 PM  

You could do what you want by updating the local resource file.

Edit the file at admin/skins/App_LocalResources/User.ascx.resx

And remove the Value for the Register Token.

tlyczko
Posts:29



12/07/2007 1:26 PM  
I also find that DNN is inserting a Register
I basically just want to not display this BUT display the user name if the user IS logged in.
I will try the *.resx edit and see what happens.
Thank you, Tom
tlyczko
Posts:29



12/07/2007 1:31 PM  
Yes, editing the *.resx file works for now -- but the anchor link is still inserted, I have not found how/where that comes from!!

It would be nice to only have the anchor link be inserted when the user is an authenticated logged in user, but not when it's an anonymous un-logged in user, but something is better than nothing!!

Thank you for showing me toward the resx files, now I understand I can edit them, but aren't these *.resx files core files that would get over-written every time I update DNN??

Thank you, Tom
John Mitchell
Posts:3033



12/07/2007 1:45 PM  

Yes, language files can be overwritten, but that is a flaw in the design of DNN. 

If you want to get rid of the whole thing you can use this code

<% If Request.IsAuthenticated Then dnnUser.Visible = "false" %>

 

 

John Mitchell
Posts:3033



12/07/2007 1:50 PM  

Sorry, you wanted the opposite.  When the user is not autheticated then you don't want to show it.

<% If NOT Request.IsAuthenticated Then dnnUser.Visible = "false" %>

tlyczko
Posts:29



12/07/2007 1:52 PM  
I commented out the DNN user token in my ascx file and put in your suggestion and got this message:
Could Not Load Skin: /Portals/_default/Skins/mls01/index_2col.ascx Error: c:\inetpub\wwwroot\Portals\_default\Skins\mls01\index_2col.ascx(14): error BC30201: Expression expected.
I was going to try this first, then reverse it.
Thank you, Tom
John Mitchell
Posts:3033



12/07/2007 1:59 PM  

Oh, it looks like I left out the quotes on the word "false" in the statement.

You don't need to comment out the skin object.

tlyczko
Posts:29



12/07/2007 2:11 PM  

Even with the quotes I still get the same error message.

I have tried to write it with a VB IIf statement but I can't get the syntax correct, this produces no errors but causes a revert to the default skin:

<%=IIf(Request.IsAuthenticated, dnnUSER.Visible, "")%>

Thank you, Tom

tlyczko
Posts:29



12/07/2007 2:17 PM  
This statement just causes DNN to display 'True' if it's not an authenticated request, the 'Register' link still appears:
<%=IIf(Request.IsAuthenticated, "", dnnUSER.Visible)%>
I can't put the user token statement into an IIf statement. :(
Thank you, Tom
John Mitchell
Posts:3033



12/07/2007 2:22 PM  
Correct, your code says:
If the user is authenticated write out nothing, else write out the state of the visible property on the dnnUser control.

If you logout the then True will not be displayed any longer.
tlyczko
Posts:29



12/07/2007 2:27 PM  
I realize this, my goal is to not display either Register or its associated link (cmdRegister), without changing any core files and hopefully not any resx files.

The If Not code generates errors and makes the site not work. :(

I hope I can figure this out...I'll have to search the internet, maybe someone else has figured this out??

Worst case, I will change the resx file. :)

Thank you, Tom
tlyczko
Posts:29



12/07/2007 2:30 PM  
The first thing I found was this:
Because I can't post to the DNN forums I did not find this:
http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/12/threadid/165067/scope/posts/Default.aspx
Set user registration to None in the Admin section...I will try this and see if this does what I need, I think it may not show the user's logged-in name, which I would like to have appear.
Thank you, Tom
John Mitchell
Posts:3033



12/07/2007 2:52 PM  

Ok, I found the reason for the error.  I was adding in the equals sign when it wasn't needed.

This is the correct code, and I tested it this time to make sure it works.

<% If NOT Request.IsAuthenticated Then dnnUser.Visible = "false" %>

robax
Posts:16



12/07/2007 3:10 PM  

Tom, I've written up a small doc about changing the language files. It's no great drama and may get you further along.

Rob

The Language Editor

The language editor has 3 modes: Admin, Host and System.

 

·         Admin mode creates new resource language files that affect a single portal of the installation and are safe from framework upgrades. The Admin “Language Editor” is accessed via the Admin “Languages” menu.

·         The Host mode creates new resource language files that affect all portals of the installation, and are also safe from framework upgrades. The Host “Language Editor” is accessed via the Host “Languages” menu. You must tick the Host” radio button after the Language Editor is loaded as it defaults to System mode.

·         System mode modifies the default resource language files and is for creating distributable language packs. Changes made to the default language/s are not safe from framework upgrades. This is the default mode of operation upon accessing the Language Editor via the Host menu.

 

You can bypass the language editor altogether and simply create copies of the desired language files with a change to the extension. Leave the copies in the same folder as the source files. Here is an example for the Profile control.

 

System default: Profile.ascx.resx

Host copy: Profile.ascx.Host.resx

Portal copy: Profile.ascx.Portal-(#).resx  (Replace (#) with the Portal ID number)

 

John Mitchell
Posts:3033



12/07/2007 3:17 PM  

Thanks Rob.  That is great info that I was not aware of.

Would you mind posting this in my tips and tricks section? Or I could copy and paste it over there, but I want to give you credit.

robax
Posts:16



12/07/2007 3:35 PM  
Hi John, I'll go and make a post there while I'm still here.
tlyczko
Posts:29



12/07/2007 6:55 PM  

Yes, this is perfect!! This does what I want.

It has to be made clear to people that one must leave the dnn:USER token UN-commented.

I did not understand this earlier.

Thank you a lot for your patience and assistance.

Thank you, Tom

chocolate
Posts:51



03/06/2008 12:24 AM  

Hi John,

Is there any token to obtain the current username?

Thanks for this great thread.

 


Pijaja.Com - Innovative Site Builder
John Mitchell
Posts:3033



03/06/2008 11:07 AM  

Hi Duc,
The current username token would look like this:

<%= UserController.GetCurrentUserInfo().Username %>
chocolate
Posts:51



03/07/2008 12:13 AM  

Thanks John,

What else are stored in UserController.GetCurrentUserInfo ?

Does that mean I can retrieve any profile property that exists?

Regards,

Duc


Pijaja.Com - Innovative Site Builder
Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Page 3 of 4<< < 1234 > >>

Forums >DotNetNuke Support >Tips-And-Tricks > DotNetNuke Tokens: Some tricks for getting more than SkinPath in your skin.



ActiveForums 3.7
Visit our Store for great DotNetNuke Modules and Skins
DNNMasters Sitemap/Google Sitemap 3.0

Item codeSM3-01
Price$29.00
Product Information 
DotNetNuke CSS NavMenu 3.3 (Developers)

Item codeCSSNM33DEV
Base Price$149.00
Product Information 
Snapsis PageBlaster 3.3.2 for DotNetNuke - Professional Edition

AuthorJohn Mitchell
Base Price$79.00
Product Information