Hi Dynamicweb,
I am working on 8.8.1, but having some trouble with the cdn image setup, when setting it up for only one website in the area settings.
When setting up the domain to Amazon I get the GetImage.ashx-path replaced with the domain from Amazon, but as a work around I try to type in the domain from the website to the image-handler, but with no luck.
In the code below it never uses this property: Pageview.Current.Area.CdnImageHost, which seems to be wrong.
Friend Shared Function GetCdnImageHostName() As String
Dim cdnImageHostName As String = String.Empty
If Pageview.Current.Area IsNot Nothing AndAlso Pageview.Current.Area.IsCdnActive.GetValueOrDefault(False) Then
cdnImageHostName = Pageview.Current.Area.CdnHost
ElseIf Dynamicweb.Input.FormatBoolean(Dynamicweb.Base.GetGs("/Globalsettings/System/cdn/active")) Then
cdnImageHostName = Dynamicweb.Base.GetGs("/Globalsettings/System/cdn/getimagehost")
End If
If String.IsNullOrEmpty(cdnImageHostName) Then
If Not cdnImageHostName.EndsWith("/", StringComparison.InvariantCultureIgnoreCase) Then
cdnImageHostName = cdnImageHostName & "/"
End If
If Not cdnImageHostName.StartsWith("http://", StringComparison.InvariantCultureIgnoreCase) AndAlso Not cdnImageHostName.StartsWith("https://", StringComparison.InvariantCultureIgnoreCase) Then
cdnImageHostName = String.Empty 'not a valid hostname. Do not do anything
End If
End If
Return cdnImageHostName
End Function
Is this a bug or am I doing something wrong?
Best regards, Anders