Hi,
I am trying to get the Apollo localization working with ifinity sitemap and urlrewrite. I am first digging into the sitemap. Erik has been very helpful by supplying me a dedicated PL3 which can pass the language and portalid so that the localized tabs are collected. What I have understood is that in PL5 this will become standard. So besides getLocalizedTab() you now have getLocalizedTab(language) and getLocalizedTab(language, portalId).
So far so good. So I get a localized TabInfo from Apollo. But then the http urlrewriter of DNN does what is given in next piece of code (DNN 4.8.4).
At (A) if you have only one local installed and not enable language in url you get the thread's culture name instead of the language you have defined.
At (B) you get the DNN tabs instead of the localized tab sent true the parameter. I actually do no understand why this loop is required? I believe removing it will speed up performance significantly. If you pass a TabInfo, why check it again if it is existing?
Any help appreciated.
J.
''' <summary>
''' Returns a full internal url
''' </summary>
''' <param name="TabID">The tab id linking to</param>
''' <param name="IsSuperTab">Is the destination tab a host tab?</param>
''' <param name="settings">the Portalsettings</param>
''' <param name="ControlKey">an optional controlkey. If no controlkey is needed, pass "" </param>
''' <param name="Language">an optional language. If language is an empty string, the current active culture will be added in the url.</param>
''' <param name="AdditionalParameters">Any aditional querystring parameters. Use this format: "param1=value1", "param2=value2", ... , "paramN=valueN"</param>
''' <returns>Returns a full internal url</returns>
''' <remarks></remarks>
Public Function NavigateURL(ByVal TabID As Integer, ByVal IsSuperTab As Boolean, ByVal settings As PortalSettings, ByVal ControlKey As String, ByVal Language As String, ByVal ParamArray AdditionalParameters As String()) As String
Dim strURL As String
If TabID = Null.NullInteger Then
strURL = ApplicationURL()
Else
strURL = ApplicationURL(TabID)
End If
If ControlKey <> "" Then
strURL += "&ctl=" & ControlKey
End If
If Not (AdditionalParameters Is Nothing) Then
For Each parameter As String In AdditionalParameters
If Not String.IsNullOrEmpty(parameter) Then
strURL += "&" & parameter
End If
Next
End If
If IsSuperTab Then
strURL += "&portalid=" & settings.PortalId.ToString
End If
'only add language to url if more than one locale is enabled, and if admin did not turn it off
If Localization.GetEnabledLocales.Count > 1 AndAlso Localization.UseLanguageInUrl Then
If Language = "" Then
strURL += "&language=" & Thread.CurrentThread.CurrentCulture.Name (A)
Else
strURL += "&language=" & Language
End If
End If
If DotNetNuke.Entities.Host.HostSettings.GetHostSetting("UseFriendlyUrls") = "Y" Then
For Each objTab As TabInfo In settings.DesktopTabs (B)
If objTab.TabID = TabID Then
Return FriendlyUrl(objTab, strURL, settings)
End If
Next
Return FriendlyUrl(Nothing, strURL, settings)
Else
Return ResolveUrl(strURL)
End If
End Function