We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19741
    • 90 Posts
    This config is based upon Wayfinder and Google Sitemap XML.. With this config you don’t need the (BBloke’s) chunks from the other thread anymore.

    How to use?
    1. Download, unzip and copy the attached file to assets/snippets/wayfinder/configs/sitemap_xml.config.php

    2. Create a document with a blank template.
    - Give it an alias of sitemap.xml
    - Set the content type to text/xml
    - Add the Wayfinder call below (you can add "level", "excludeDocs" etc.).

    [!Wayfinder?  &startId=`0` &config=`sitemap_xml`!]




    Result with this config: http://www.ardiman.de/sitemap.xml (i’m using Ditto now - you can find a Ditto format file on: Google Sitemap with Ditto (Click me))


    [Edit] Changed the config-file -> it’s results will validate on http://www.validome.org/google/ [/Edit]
      Bye,
      Mithrandir
      • 25663 MODX Staff
      • 12,272 Posts
      Nice sir!
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 10071
        • 18 Posts
        This is very handy grin

        It works directly super!
          • 9543
          • 2 Posts
          Hi, very useful and seems to work fine on Modx 0.9.6.3.

          I am novice MODX user and could do with a little help on how you can exclude pages and ad last mod info etc.

          I assume that the [!Wayfinder? &startId=`0` &config=`sitemap_xml`!] call can be amended to ad these parameters. I don’t suppose you could give me an example that would provide:-

          <lastmod>2005-01-01</lastmod> and <priority>0.8</priority> within the sitemap output.

          I would like the <lastmod> info to be derived from the server and wondered whether I could set the <priority> using a TV perhaps. Also is there a way of setting the <changefreq> on a page by page basis.

          Thanks in advance
            • 19741
            • 90 Posts
            Hi,

            sorry - i don’t see any chance to achieve your goal(s) with wayfinder - use Ditto instead of wayfinder: Google Sitemap with Ditto (click me).
              Bye,
              Mithrandir
              • 21872
              • 95 Posts
              The config pack doesn’t seem to work with Wayfinder 2 and/or Evolution version 1.x.

              Wayfinder 2, at least, makes setting up what I think fE1 is requesting a relatively straightforward activity.

              First, download the attached sitemap_xml.config.php file and put it in /assets/snippets/wayfinder/configs

              Next, create three new TVs:
              for change frequency
              TV: changfreq
              Input Type: DropDown ListMenu
              Input Option Values: always||hourly||daily||weekly||monthly||yearly||never
              Default Value: weekly
              


              for priority
              TV: priority
              Input Type: DropDown ListMenu
              Input Option Values: .1||.2||.3||.5||.6||.7||.8||.9||1 
              Default Value: .5
              


              For last modified dateEdit: this doesn’t appear to work after all, sorry
              TV: lastmod
              Input Type: text (or date, doesn't seem to matter)
              Input Option Values: LEAVE BLANK
              Default Value: @EVAL return date("Y-m-d", $modx->documentObject['editedon']);
              


              and assign each to template(s) used by the documents you wish to see listed in the sitemap.

              Finally, create a new resource using an empty template and setting the content type to text/xml and paste this as your content:

              <?xml version="1.0" encoding="UTF-8"?>
              <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">
              [!Wayfinder? &startId=`0` &excludeDocs=`#` &config=`sitemap_xml`!]
              </urlset>


              I didn’t know whether I should post this here or start a new thread, sorry if I chose wrong.