We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2912
    • 315 Posts
    Hi All,

    I have recently come across this post and thought I could use the info for making an XML sitemap for Google Webmaster Tools.

    Here is what I have:

    1a. Create a document with a blank template.
    1b. Give it an alias of sitemap.xml
    1c. Set the content type to text/xml
    1d. Add the Wayfinder call below.

    Wayfinder Call:
    [!Wayfinder?  &startId=`0` &level=`2` &parentClass=`hide` &parentRowTpl=`cssplay_parentRow` &outerTpl=`cssplay_outer`&innerTpl=`cssplay_inner` &rowTpl=`cssplay_row` &fullLink=`True` &excludeDocs=`123,187,147,74,113,7,8,4,37,46,59,228,79,52` &ignoreHidden=`True`!]
    


    I have used &excludeDocs to remove anything I don’t want listed. Mainly Admin pages, searhc results pages and the like. Also remove any document or container where you use external links to other sites (Google will flag these as an error anyway - unless they are links to YOUR site pages.)

    2. Create the following chunks:

    cssplay_inner
    cssplay_outer
    cssplay_row
    cssplay_parentRow

    and add the following text to each chunk:

    cssplay_inner
    [+wf.wrapper+]
    


    cssplay_outer
    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    [+wf.wrapper+]
    </urlset>
    


    cssplay_parentRow
    <url>
        <loc>[+wf.link+]</loc>
        <changefreq>weekly</changefreq>
    </url>
    [+wf.wrapper+]
    


    cssplay_row
        <url>
            <loc>[+wf.link+]</loc>
        </url>
    


    3. Now use Google Webmaster Tools and add your sitemap via the appropriate link.
      BBloke
      • 4310
      • 2,310 Posts
      Looks good, will be trying it ASAP.
        • 19741
        • 90 Posts
        @BBloke : Thank you for this nice solution! Works fine for me.
          Bye,
          Mithrandir
          • 7231
          • 4,205 Posts
          Cool use of wayfinder. Ditto is normally the tool for this sort of thing, but WF seems up to the task. grin
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don&#39;t know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 19741
            • 90 Posts
            I just added a config for this solution: [config] Wayfinder config pack for Sitemap XML.
              Bye,
              Mithrandir