Friday, August 29, 2008     | Register
My Posts
 
  Forums  DotNetNuke  Smart-Thinker E...  Smart Thinker List Without Frienly URL's
Previous Previous
 
Next Next
New Post 2/13/2007 11:59 AM
  Clint Crowe
9 posts
5th Level Poster


Smart Thinker List Without Frienly URL's  (United States)
Hello,

I have Event module version 04.03.01 DNN version 04.04.00. I have the smart-thinker events and event detail modules installed and they work great with Friendly URL's, however I have a need to not use Friendly URL's on my site, and when I do this the list view creates the link to event details with a ID&4 instead of ID=4. Is there anything I can do about this?

thanks,

Clint
 
New Post 2/13/2007 12:29 PM
  Rodney Joyce
2608 posts
www.DNNDir.com
1st Level Poster




Re: Smart Thinker List Without Frienly URL's  (N/A)
Hi Clint,

Hmm - I find Friendly Urls invaluable for SEO - out of interest can you share your reason for not using them?

Ok  - I've switched back on my dev server and I can see this happening. I am about to release the new Events version, so I'll get this fixed (next 3-4 days).




Thanks
Rodney
See our modules in action on PokerDIY, a social network for home poker players

Smart-Thinker DotNetNuke Development Blog
 
New Post 2/13/2007 12:39 PM
  Clint Crowe
9 posts
5th Level Poster


Re: Smart Thinker List Without Frienly URL's  (United States)
The reason is that I am creating a module that displays a library of information that is stored in html in a database. The module needs a pageid passed too it so it knows what content to display. In the html code links to other library pages are in the form .. href="content.asp?pageid=P00000". If I don't use friendly urls I can simply use the strings Replace function content.replace("content.asp?pageid", "default.aspx?tabid=" & PortalSettings.ActiveTab.TabId & "&pageid") because the pageid is always changing I would have to do some regex pattern matching or other string manipulation to change the links embedded in the html content. I am under a bit of a time constraint so for now the best thing for me to do was remove Friendly URL's. I will probably explore a way to do this with Friendly URL's when I have some more time.

Thank you for your timely response!
 
New Post 2/13/2007 12:48 PM
  Rodney Joyce
2608 posts
www.DNNDir.com
1st Level Poster




Re: Smart Thinker List Without Frienly URL's  (N/A)
Hmm - I am not sure I understand correctly - are you familiar with the NavigateURL method? If not, you can use this (regardless of whether you are using FURLS or not - it renders the link accordingly) - or are you saying that the HTML content HAS to be in the non FURL format.

Either way - you can fix your proble by tweaking the .ascx files (ie. without source)
MyEventsView.ascx-  this line:

="linkEvent" CssClass='<%# (eventDetailTabID == -1 ? "" : "NormalRed") %>' runat="server" NavigateURL='<%# (eventDetailTabID == -1 ? "" : DotNetNuke.Common.Globals.NavigateURL(eventDetailTabID, "", "ID", Eval("EventID").ToString())) %>' text='<%# Eval("EventName") %>' />

TO

                          ="linkEvent" CssClass='<%# (eventDetailTabID == -1 ? "" : "NormalRed") %>' runat="server" NavigateURL='<%# (eventDetailTabID == -1 ? "" : DotNetNuke.Common.Globals.NavigateURL(eventDetailTabID, "", "ID=" + Eval("EventID").ToString())) %>' text='<%# Eval("EventName") %>' />

Do the same for the EventsView.ascx...

Thanks, I learnt something about NavigateURL there - will have to check my other modules too...

Thanks
Rodney
See our modules in action on PokerDIY, a social network for home poker players

Smart-Thinker DotNetNuke Development Blog
 
New Post 2/14/2007 4:39 AM
  Clint Crowe
9 posts
5th Level Poster


Re: Smart Thinker List Without Frienly URL's  (United States)
Thank you that worked perfectly. I will attempt to explain a little better in case you can think of a quick solution that does not involve turning off friendly URL's.

Yes I am familiar with the NavigateURL function and use it quite frequently. What I am doing is pulling data from a database table with 8000+ records where each record represents a single "page" of web content. Each record has a pageid field, content field and various other fields. My module reads the pageid to display in from the Querystring, does a DB lookup and pulls the content field and writes that to an asp:literal control. Here is an abbreviated sample content field:



The cardiovascular system is made up of the heart and blood vessels. Cardiovascular diseases (CVD), as defined by the American Heart Association, include coronary heart disease (coronary artery disease, ischemic heart disease); stroke (brain attack); high blood pressure (hypertension); and rheumatic heart disease.



Picture of an electrocardiogram strip

...

notice the href for the "internal_link" anchor tags. Obviously if I display them as is the will not work. So I have to do a String.Replace on the contents of this field. Currently I would do this where strContent contains the content of this field: strContent = strContent.Replace("content.asp?pageid", "default.aspx?tabid=" & PortalSettings.ActiveTab.TabId & "&pageid"). So now my href's will look like "default.aspx?tabid=001&pageid=P00000" (obviously the tabid and pageid will vary). If I use Friendly URL's then href would look like this ".../tabid/54/pageid/P00225/default.aspx?tabid=54&pageid=P00214" which when the link is followed ignores the querystring values after the ? and just navigates back to page P00225 not P00214 like it should.

If I try this code: strContent.Replace("content.asp?pageid", NavigateURL(PortalSettings.ActiveTab.tabid, "", "pageid")) then I get href's like this: ".../tabid/54/pageid/default.aspx=P00214" which will obviously not work.

I realize that I could loop through the content field matching the string "content.asp?pageid=" then get the next 6 characters remove and replace with NavigateURL(PortalSettings.ActiveTab.TabID, "", "pageid=" & (pageid)) but I have not taken the time to write a procedure to do this, so have gone with the simpler (if slightly less elegant) approach for the time being. I hope this makes my situation a little more clear.

Thanks for your help! Sorry this post kind of turned into a novel.
 
New Post 2/14/2007 4:41 AM
  Clint Crowe
9 posts
5th Level Poster


Re: Smart Thinker List Without Frienly URL's  (United States)
Sorry, the above post was meant to show the HTML code not the rendered HTML.
 
New Post 2/14/2007 4:43 AM
  Clint Crowe
9 posts
5th Level Poster


Re: Smart Thinker List Without Frienly URL's  (United States)
 boilermanc wrote
Thank you that worked perfectly. I will attempt to explain a little better in case you can think of a quick solution that does not involve turning off friendly URL's.

Yes I am familiar with the NavigateURL function and use it quite frequently. What I am doing is pulling data from a database table with 8000+ records where each record represents a single "page" of web content. Each record has a pageid field, content field and various other fields. My module reads the pageid to display in from the Querystring, does a DB lookup and pulls the content field and writes that to an asp:literal control. Here is an abbreviated sample content field:

"

The cardiovascular system is made up of the heart and blood vessels. Cardiovascular diseases (CVD), as defined by the American Heart Association, include coronary heart disease (coronary artery disease, ischemic heart disease); stroke (brain attack); high blood pressure (hypertension); and rheumatic heart disease.



Picture of an electrocardiogram strip"

...

notice the href for the "internal_link" anchor tags. Obviously if I display them as is the will not work. So I have to do a String.Replace on the contents of this field. Currently I would do this where strContent contains the content of this field: strContent = strContent.Replace("content.asp?pageid", "default.aspx?tabid=" & PortalSettings.ActiveTab.TabId & "&pageid"). So now my href's will look like "default.aspx?tabid=001&pageid=P00000" (obviously the tabid and pageid will vary). If I use Friendly URL's then href would look like this ".../tabid/54/pageid/P00225/default.aspx?tabid=54&pageid=P00214" which when the link is followed ignores the querystring values after the ? and just navigates back to page P00225 not P00214 like it should.

If I try this code: strContent.Replace("content.asp?pageid", NavigateURL(PortalSettings.ActiveTab.tabid, "", "pageid")) then I get href's like this: ".../tabid/54/pageid/default.aspx=P00214" which will obviously not work.

I realize that I could loop through the content field matching the string "content.asp?pageid=" then get the next 6 characters remove and replace with NavigateURL(PortalSettings.ActiveTab.TabID, "", "pageid=" & (pageid)) but I have not taken the time to write a procedure to do this, so have gone with the simpler (if slightly less elegant) approach for the time being. I hope this makes my situation a little more clear.

Thanks for your help! Sorry this post kind of turned into a novel.
 
Previous Previous
 
Next Next
  Forums  DotNetNuke  Smart-Thinker E...  Smart Thinker List Without Frienly URL's
© 2008 Smart-Thinker   |  Privacy Statement  |  Terms Of Use