Quick Nav:  Online Store   |   Login | Register

Need some ideas for DisplayName in URL

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.
AuthorMessages
Rodney
<100 Posts
Posts:85


05/21/2008 10:18 PM  

Hi John,

I am writing this here because you are an expert an URL rewriting and generally a smart guy and I would appreciate your comments ;)

Basically, in my Smart-Thinker UserProfile module, instead of this URL:

http://www.pokerdiy.com/Home/PokerPlayerProfile/tabid/391/ID/1/Default.aspx

I want to use the DisplayName:

http://www.pokerdiy.com/rodney

So, from my limited knowledge of URL rewriting, I need to have some sort of look-up title that maps DisplayName (I don't think this has to be unique, which could be an issue) to UserID. I then rewrite the URL with the new format. This sounds simple enough in theory, but how do I actually implement this? It does not neccessarily have to be a module solution (although it would be good if I could somehow build it into my UserProfile module for ease of use) but I am open to suggestions (ie. IIS changes, HTTP Module etc.).

My first thought was an HTTP handler in the UserProfile module (like my image handler). So you would call it like this directly:

    http://www.pokerdiy.com/desktopmodules/smartthinker_userprofile/Name/Rodney/GetUser.aspx

then once that is working I could use PageBlaster to make it even prettier and change the URL to:

    http://www.pokerdiy.com/rodney

The handler itself would do a query on the DB by DisplayName and rewrite (?!?!) the URL to UserId (this is so that all other satellite modules on the page that use userID function as normal).

I am worried about performance hits with this approach and not sure how to actualy implement the last bit technically. Any comments please?

 


thanks
Rodney Joyce
Smart-Thinker.com - DotNetNuke Modules for Social Networks
PokerDIY.com - Simple Poker Leagues
John Mitchell
Posts:3276


05/22/2008 7:29 AM  
Hi Rodney,

Ironically, I was asked a very similar question by another module vendor recently. I'll give this some serious thought over the weekend and see if I can come up with something that allows module devs an API, or work it out in some way that allows this to be done on any module.

PageBlaster already has Plug-In capability so it may just be a matter of adding a Plug-In for PageBlaster.
Rodney
<100 Posts
Posts:85


05/22/2008 6:45 PM  
Thats great to hear John - I look forward to your findings!

thanks
Rodney Joyce
Smart-Thinker.com - DotNetNuke Modules for Social Networks
PokerDIY.com - Simple Poker Leagues
Rodney
<100 Posts
Posts:85


06/02/2008 7:55 AM  
Hey John, have you had any time to look in to this a bit more?

thanks
Rodney Joyce
Smart-Thinker.com - DotNetNuke Modules for Social Networks
PokerDIY.com - Simple Poker Leagues
Rodney
<100 Posts
Posts:85


06/02/2008 7:59 AM  
ps - I started this thread on the DNN core forums regarding unique DisplayNames - http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/118/threadid/231151/scope/posts/Default.aspx

thanks
Rodney Joyce
Smart-Thinker.com - DotNetNuke Modules for Social Networks
PokerDIY.com - Simple Poker Leagues
Rodney
<100 Posts
Posts:85


07/23/2008 8:26 PM  
Hi John,

Any more thoughts on this?

thanks
Rodney Joyce
Smart-Thinker.com - DotNetNuke Modules for Social Networks
PokerDIY.com - Simple Poker Leagues
John Mitchell
Posts:3276


07/24/2008 7:21 AM  
Hi Rodney,
I did get something new for PageBlaster so that 301 & 302 redirects, and Rewrites can be better setup with wildcards.

I don't think it will address your specific need though.
What you need turns out to be very tough to implement in a generic way. It almost needs a custom solution.
I kind of put it on the back burner because I thought you were using the UrlMaster module for that.
Rodney
<100 Posts
Posts:85


07/24/2008 7:39 PM  
Hmm - yes, I think I am going to have to write an HTTML Handler that resolves the DisplayName to a UserID and does a redirect. It just seems like it's inefficient. There is also the problem of the DisplayName not being unique...

I would then use PageBlaster to make the URL slightly more friendly although it's still going to have to have the handler page name in it somewhere, something like www.pokerdiy.com/player/rodney

URL Master works great but it can't do that (I've seen a lot of posts regarding PB and UM issues together, but they are both working fine together on PokerDIY).

On another note, I received a referral payment from you - it bounced back as my PP address is different - can you use sale . smart-thinker.com please.

thanks
Rodney Joyce
Smart-Thinker.com - DotNetNuke Modules for Social Networks
PokerDIY.com - Simple Poker Leagues
John Mitchell
Posts:3276


07/26/2008 8:22 AM  
Yes, you will need something that is unique unless you want to send them to a page that lists all the possibilities when there is more than one match.

I'll give this some more thought. One thing I was thinking of adding is the ability for the admin to define a url pattern (or patterns) that will automatically be converted into a "tiny url" using a short unique key. The drawback of this approach is that you don't know what the long url will turn into until it has been added, and then it is not really "friendly" it is just short.

Another way would be for me to allow the admin to attach a lookup query based on part of the Url, but that only gets us back to having to put enough info in the url to perform the lookup correctly.

If you are willing to have a Url with a unique Id in it then you could do it with SiteUrls.config (from DNN) or the ResourceLocationTable.config (from PageBlaster). So you could have:

http://www.pokerdiy.com/player/userid --> rewrite to --> http://www.pokerdiy.com/Home/PokerPlayerProfile/tabid/391/ID/1/Default.aspx

You could also force your users to create a unique Display Name (screen name), which may be their username anyway and then use that to lookup the profile in your module instead of (or in addition to) userid.

---
I'll send out that referral payment to the other address now.

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Forums >Snapsis Product Support >PageBlaster > Need some ideas for DisplayName in URL



ActiveForums 3.7
Powered by: Snapsis Software