We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21191
    • 236 Posts
    http://modxguides.com/modx1x/google-sitemap-with-ditto

    Here ya go. I need to get commenting and such on the site, but well see.
      ~Shawn Himmelberger
      Check out my MODx Development and MODx Design Company - Himmelberger Design
      • 18397
      • 3,250 Posts
      MARKSVIRTUALDESK Reply #2, 17 years ago
      Excellent tutorial! Please note that if you are using Ditto 2 you don’t need the tv prefix and descendentDepth is simply depth.
        • 21191
        • 236 Posts
        Edit made smiley
          ~Shawn Himmelberger
          Check out my MODx Development and MODx Design Company - Himmelberger Design
          • 19554
          • 59 Posts
          Do we have your permission to put this tutorial on wiki? Thanx in advance!
            • 17673
            • 194 Posts

            Hi, I tried this Ditto approach after not succeeding with the [[Sitemap]] snippet.

            Interestingly I am getting exactly the same errors!

            see http://modxcms.com/forums/index.php/topic,5754.0.html
              ----------------------------------------------------------
              http://www.linkedin.com/in/lucapost/
              http://www.twitter.com/lukwe/
              ----------------------------------------------------------
              • 6726
              • 7,075 Posts
              Woot great stuff neon-eddy, a great testimony to Ditto’s versatility grin
              Sure belongs in the wiki !
                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l'outil id
                • 18397
                • 3,250 Posts
                MARKSVIRTUALDESK Reply #7, 17 years ago
                @lukwe: Try it without setting the page to be xml.
                  • 17673
                  • 194 Posts
                  @lukwe: Try it without setting the page to be xml.

                  That’s how I get to see the error:
                  [tt]PHP error debug
                  Error: explode() [function.explode]: Empty delimiter.
                  Error type/ Nr.: Warning - 2
                  File: /user0/htdocs/modx/manager/includes/document.parser.class.inc.php(724) : eval()’d code
                  Line: 195[/tt]

                  If I leave it as xml I only get a blank/empty page.

                  If I make the same Ditto call from a regular HTML page with template and no

                  [tt]<?xml version="1.0" encoding="UTF-8"?>..[/tt] stuff, I do get the output.

                  The Ditto call is: [tt][[Ditto?parents=`15,258`&tpl=`DittoSitemap`&dateSource=`editedon`&display=`all`&sortBy=`createdon`&depth=`4`&showInMenuOnly=`1`]][/tt]

                  the DittoSitemap chunk is:
                  [tt]<url>
                  <loc>[(site_url)][~[+id+]~]</loc>
                  <lastmod>[+date+]</lastmod>
                  <priority>[+priority+]</priority>
                  </url>[/tt]
                    ----------------------------------------------------------
                    http://www.linkedin.com/in/lucapost/
                    http://www.twitter.com/lukwe/
                    ----------------------------------------------------------
                    • 21191
                    • 236 Posts
                    I plan on writing more good works, and for future things, yes, you have my permission for this and all tutorials, maybe just give me a link to my company / project site http://wavestatic.com / http://webbake.com respectively

                    To those getting goofy errors make sure your priority template variable looks like this. (attached image)

                    for debugging purposes I would set the doctype to be html, once is spits out good xml, then switch it.

                      ~Shawn Himmelberger
                      Check out my MODx Development and MODx Design Company - Himmelberger Design
                      • 17673
                      • 194 Posts

                      I finally got it right; when I pasted from your tutorial I added a closing tag for XML, which is actually not in the sitemap schema.

                      I also had to put a ’&dateFormat=`%Y-%m-%d`’ in the Ditto call, ’cause the Google Sitemap checker was complaining...

                        ----------------------------------------------------------
                        http://www.linkedin.com/in/lucapost/
                        http://www.twitter.com/lukwe/
                        ----------------------------------------------------------