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

    This snippet is great! Installed it and everything works perfectly ...
    It seems that the specs moved to sitemap 0.9 in the meantime ... I replaced the line 144 of the SiteMap Snippet
    $output = '<?xml version="1.0" encoding="UTF-8"?>'."\n".'<?xml-stylesheet type="text/xsl" href="sitemap.xsl"?>'."\n".'<urlset xmlns="http://www.google.com/schemas/sitemap/0.84" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">'."\n";

    with
    $output = '<?xml version="1.0" encoding="UTF-8"?>'."\n".'<?xml-stylesheet type="text/xsl" href="sitemap.xsl"?>'."\n".'<urlset 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" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'."\n";


    and the line 39 of sitemap.xsl
    xmlns:sitemap="http://www.google.com/schemas/sitemap/0.84"

    with
    xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"


    ... it seems to work ...
      my newest webpage [url=http://gitarren.zucali.at]Meisterwerkstatt f
      • 25663 MODX Staff
      • 12,272 Posts
      Thanks raun. Maybe you could add it to the release in the repository as a new version. smiley
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 24530
        • 100 Posts
        Quote from: rthrash at Mar 20, 2007, 02:53 PM

        Thanks raun. Maybe you could add it to the release in the repository as a new version. smiley

        I think my contribution to this snippet is too small to release it under my name ;-) And I think, somebody should release a version which includes grad´s modifications or picachu´s modification too ... these work fine, at least for me ...
          my newest webpage [url=http://gitarren.zucali.at]Meisterwerkstatt f
          • 36541
          • 222 Posts
          Ryan, I’ll try to update the snippet soon. At last smiley
            This is the web: the only thing you know about who will come is that you don't know who will come.
            • 17673
            • 194 Posts
            Quote from: canada at Feb 04, 2007, 12:29 PM

            Hi,
            I followed the instructions on the wiki and keep getting the same error when I try to access the sitemap.
            (mysite.com/sitemap.xml) and in the manager by clicking on the document.

            XML Parsing Error: undefined entity
            Location: http://localhost/modx/index.php?id=1468&z=manprev
            Line Number 2, Column 56: <html><head><title>MODx Content Manager &raquo; </title>

            Hi, I’m getting the same exact error output of ’canada’; my call to sitemap is just
            [!SiteMap? &format=`sp` &startid=`25`!]


            ?!
              ----------------------------------------------------------
              http://www.linkedin.com/in/lucapost/
              http://www.twitter.com/lukwe/
              ----------------------------------------------------------
              • 14050
              • 788 Posts
              Make sure you have the template set to "blank" and you utilized the stylesheet mentioned at the end of the Wiki article.
                Jesse R.
                Consider trying something new and extraordinary.
                Illinois Wine

                Have you considered donating to MODx lately?
                Donate now. Every contribution helps.
                • 17673
                • 194 Posts

                Blank template and ’text/xml’ content-type are already set for both the sitemap.xml and the xsl.

                It was working correctly (but not listing the whole documents set) before I inserted the &startid parameter, which I need because the starting doc is in a subfolder.
                  ----------------------------------------------------------
                  http://www.linkedin.com/in/lucapost/
                  http://www.twitter.com/lukwe/
                  ----------------------------------------------------------
                  • 36541
                  • 222 Posts
                  Quote from: lukwe at Mar 27, 2007, 12:06 PM

                  XML Parsing Error: undefined entity
                  Location: http://localhost/modx/index.php?id=1468&z=manprev
                  Line Number 2, Column 56:              <html><head><title>MODx Content Manager  » </title>
                  


                  I guess the problem is the entity you are using. As far as I can tell XML requires entities to be defined with decimal notation. XML is far more restrictive than HTML, which allows to use keywords notation. Anyway, try using [tt]&\#187;[/tt] (remove the backslash) instead of [tt]&raquo;[/tt] and let us know if it worked.
                    This is the web: the only thing you know about who will come is that you don't know who will come.
                    • 17673
                    • 194 Posts
                    Quote from: grad at Mar 28, 2007, 01:54 AM

                    (...) try using [tt]&\#187;[/tt] (remove the backslash) instead of [tt]&raquo;[/tt] and let us know if it worked.

                    sorry... but I’m (still) clueless... such output is not generated inside the Sitemap snippet php code, where should I go to edit that ?!

                      ----------------------------------------------------------
                      http://www.linkedin.com/in/lucapost/
                      http://www.twitter.com/lukwe/
                      ----------------------------------------------------------
                      • 36541
                      • 222 Posts
                      Quote from: lukwe at Mar 28, 2007, 04:33 AM

                      such output is not generated inside the Sitemap snippet php code, where should I go to edit that ?!

                      Ehm, when I look at the error code again, I see I was tricked by that instant thought about entities. I was wrong. However, I’m quite sure, the issue with entities notation in XML is true.

                      I think your error comes from elswhere. The first thing - SiteMap produces pure XML output, which doesn’t contain any HTML markup. It should look like this:

                      <?xml version="1.0" encoding="UTF-8"?>
                      <?xml-stylesheet type="text/xsl" href="sitemap.xsl"?>
                      <urlset xmlns="http://www.google.com/schemas/sitemap/0.84" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">
                      	<url>
                      		<loc>http://domain.com/index.html</loc>
                      		<lastmod>2006-12-12</lastmod>
                      	</url>
                      </urlset>
                      


                      As you can see, there’s no place for the errorenous HTML markup you provided. If there is any then you are using not empty template, which contains HTML markup for either sitemap.xml or sitemap.xls or both. Double check it. Check the source of those two documents.

                      The second thing - your error comes from the MODx manager internal preview! This is indicated by the URL [tt]Location: http://localhost/modx/index.php?id=1468&z=manprev[/tt]. Notice the [tt]&z=manprev[/tt] part. Don’t use the internal preview for your sitemap but check the live site!
                        This is the web: the only thing you know about who will come is that you don't know who will come.