Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...All the URLs in your Sitemap have the same priority. DNN SiteMap.aspx IssueAll the URLs in your Sitemap have the same priority. DNN SiteMap.aspx Issue
Previous
 
Next
New Post
1/8/2009 9:49 AM
 

Ok guys, not quite 5 minutes later and Google has successfully accepted my sitemap.

I will be posting a patch today.


Maxiom TechnologyAntonio Chagoury | Microsoft MVP
Maxiom Technology
Professional .net & DotNetNuke Solutions
web: www.maxiomtech.com
blog: www.cto20.com
twitter: @antoniochagoury & @maxiomtech

 
New Post
1/8/2009 11:18 AM
 

Here is an exemple of changed sitemap.aspx.vb on DNN 4.8.2 (changes à marked in yelow, very small changes)

With give priority 1 to home page and 0.9 to other 1st lavel pages , 0.8 to 2nd level pages , ...


Imports System.Text
Imports DotNetNuke.Entities.Tabs

Namespace DotNetNuke.Common.Utilities

    ''' -----------------------------------------------------------------------------
    ''' <summary>
    ''' The LinkClick Page processes links
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks>
    ''' </remarks>
    ''' <history>
    ''' </history>
    ''' -----------------------------------------------------------------------------
    Partial Class SiteMap
        Inherits Framework.PageBase

        Const SITEMAP_CHANGEFREQ As String = "daily"
        Const SITEMAP_PRIORITY As String = "0.8"
        Const SITEMAP_MAXURLS As Integer = 50000

#Region "Event Handlers"

        ''' -----------------------------------------------------------------------------
        ''' <summary>
        ''' Page_Load runs when the control is loaded.
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks>
        ''' </remarks>
        ''' <history>
        ''' </history>
        ''' -----------------------------------------------------------------------------
        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

            Try
                Response.ContentType = "text/xml"
                Response.ContentEncoding = Encoding.UTF8
                Response.Write(BuildSiteMap(PortalSettings.PortalId))
            Catch exc As Exception

            End Try

        End Sub

#End Region

#Region "Private Methods"

        ''' -----------------------------------------------------------------------------
        ''' <summary>
        ''' Builds SiteMap
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks>
        ''' </remarks>
        ''' </history>
        ''' -----------------------------------------------------------------------------
        Public Function BuildSiteMap(ByVal PortalID As Integer) As String

            Dim sb As New StringBuilder(1024)
            Dim URL As String
            Dim Priority As String

            ' build header
            sb.Append("<?xml version=""1.0"" encoding=""UTF-8""?>" & ControlChars.CrLf)
            sb.Append("<urlset xmlns=""http://www.sitemaps.org/schemas/sitemap/0.9"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:schemaLocation=""http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"">" & ControlChars.CrLf)

            ' add urls
            Dim intURLs As Integer = 0
            Dim objTabs As New TabController
            For Each objTab As TabInfo In objTabs.GetTabs(PortalID)
                If objTab.IsDeleted = False AndAlso objTab.DisableLink = False AndAlso objTab.IsVisible AndAlso objTab.TabType = TabType.Normal AndAlso ((Null.IsNull(objTab.StartDate) = True OrElse objTab.StartDate < Now) AndAlso (Null.IsNull(objTab.EndDate) = True OrElse objTab.EndDate > Now)) Then
                    ' the crawler is an anonymous user therefore the site map will only contain publicly accessible pages
                    If PortalSecurity.IsInRoles(objTab.AuthorizedRoles) Then
                        If intURLs < SITEMAP_MAXURLS Then

                            intURLs += 1
                            URL = objTab.FullUrl

                            If objTab.TabID = PortalSettings.HomeTabId Then
                                Priority = 1
                            ElseIf objTab.Level > 9 Then
                                Priority = 0.1
                            Else
                                Priority = (1 - ((objTab.Level + 1) * 0.1)).ToString(CultureInfo.InvariantCulture)
                            End If


                            If URL.ToLower.IndexOf(Request.Url.Host.ToLower) = -1 Then
                                URL = AddHTTP(Request.Url.Host) & URL
                            End If
                            sb.Append(BuildURL(URL, Priority, 2))
                        End If
                        End If
                    End If
            Next

            sb.Append("</urlset>")

            Return sb.ToString

        End Function

        Private Function BuildURL(ByVal URL As String, ByVal Priority As String, ByVal Indent As Integer) As String

            Dim sb As New StringBuilder(1024)

            sb.Append(WriteElement("url", Indent))
            sb.Append(WriteElement("loc", URL, Indent + 1))
            sb.Append(WriteElement("lastmod", DateTime.Now.ToString("yyyy-MM-dd"), Indent + 1))
            sb.Append(WriteElement("changefreq", SITEMAP_CHANGEFREQ, Indent + 1))
            sb.Append(WriteElement("priority", Priority, Indent + 1))
            sb.Append(WriteElement("/url", Indent))

            Return sb.ToString

        End Function

        Private Function WriteElement(ByVal Element As String, ByVal Indent As Integer) As String
            Dim InputLength As Integer = Element.Trim.Length + 20
            Dim sb As New StringBuilder(InputLength)
            sb.Append(ControlChars.CrLf.PadRight(Indent + 2, ControlChars.Tab))
            sb.Append("<").Append(Element).Append(">")
            Return sb.ToString
        End Function

        Private Function WriteElement(ByVal Element As String, ByVal ElementValue As String, ByVal Indent As Integer) As String
            Dim InputLength As Integer = Element.Trim.Length + ElementValue.Trim.Length + 20
            Dim sb As New StringBuilder(InputLength)
            sb.Append(ControlChars.CrLf.PadRight(Indent + 2, ControlChars.Tab))
            sb.Append("<").Append(Element).Append(">")
            sb.Append(ElementValue)
            sb.Append("</").Append(Element).Append(">")
            Return sb.ToString
        End Function

#End Region

    End Class

End Namespace
 

 

 

 
New Post
1/8/2009 11:27 AM
 

please submit your enhancement suggestion to the public issue tracker (2nd from top) at support.dotnetnuke.com.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
1/9/2009 2:50 PM
 

Antonio-
I only took a quick look but I didn't see a link for the Google sitemap version (with page priority values) of your demo.  Can you share that for your demo?
 

The Issue with Page Priorty Based on Menu-Hierarchy
Sacha-
Thanks for the code post!  I had considered the same modification (assign page priority based on menu level) but discarded the idea for a couple of reasons:

Reason #1: "Transitional" tabs (tabs used only to group other tabs)
Sites with "transitional" menu items (menu items/tabs that exist purely to group similar child items/tabs) you would end up with empty or non-essential parent pages getting higher priority ranking than their content-rich child pages.  This was the main reason why my posted update/tweak relied only on user-settable elements (page description, keywords) to modify a page's priority value rather than try to guess a priority value based on a page's location, number of modules, size of content, etc.

Example:
You have a number of blog pages (for different authors) grouped together under a "Blogs" tab.  Your home page features links to the individual blog pages so you really have no unique content for the "Blogs" tab itself -- it's just used to nicely group the individual child blog pages in your menu.  You can repeat the list of links to the individual blogs on the "Blogs" tab (so it won't be an empty page) but you may not want to give higher priority to the "Blogs" page since it's redundant -- you want priority given to "Home" followed by the individual blog pages.

For sites where users routinely create new pages/content we encounter many cases of such "transitional" tabs that have no unique content -- they exist only to group similar child tabs.  In practice we encourage the users to provide something on those pages (at minimum a list of links to the child tabs).  Even so, users often wish the content pages (child tabs) to have higher priority than the navigational pages (parent tabs).

Reason #2:  Important Child Tabs
Even with sites without "transitional" tabs we have cases where our users wish to give a certain child page (say, for a certain very popular product) higher priority than pages above it.  Even for pages at the same "level" in the menu system, you may wish to give more priority to a product page than to a "Contact Us" page.  In these cases the only good solution is to give the site's content manager a way to specify page priority values for individual pages without regard to a page's location within the site menu.


I've finally gotten around to making a quick pass at such a solution (allow users to assign page priority values on a page-by-page basis) but it still has a bug or two -- as soon as I iron those out and feel that the solution is worthy I'll post it.

-mamlin


esmamlin atxgeek.me
 
New Post
1/12/2009 10:57 AM
 

Sugestion is reported to support.dotnetnuke.com

http://support.dotnetnuke.com/issue/ViewIssue.aspx?id=9208&PROJID=23

 

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...All the URLs in your Sitemap have the same priority. DNN SiteMap.aspx IssueAll the URLs in your Sitemap have the same priority. DNN SiteMap.aspx Issue


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out