We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4643
    • 34 Posts
    Hi!
    I’m new to MODx, this is my first post...please bear with me as I’m still learning.

    Anyway, I got the same sort of problems as joshlfisher and arphaus. I also had to remove the rich text editor etc and got to the "Error loading stylesheet..." bit.

    Thing is I don’t trust this. I use FireFox and if I point it to any of my old domains and askfor www.olddomain.com/sitemap.xml it shows up just fine. So it seems to me that this error message really means there is nothing there.

    If I change the file type in MODx to text/plain (instead of as it says in the instruction text/xml) it seems to work better. When viewed with Firefox, there is a correct sitemap file showing up.
      • 14779
      • 256 Posts
      Google says my sitemap is working fine smiley

      I guess the only thing not working is the ability to view the map directly.
        PM me to find out how you can get a FREE ipad 2!
        • 4643
        • 34 Posts
        Hmm, you’re probably right. I think I jumped into a conclusion there.

        The "correct" sitemap file I could see looked right but a bit slightly different than the ones I have on my other sites (generated by some online sitemap generator and OK’d by Google). After looking a bit closer, I suspect it is not a correct sitemap. I can’t validate with Google yet - don’t like to tell them about the site before it is ready.

        It’s all a bit confusing, most of it probably because I never understood the XML stuff anyway....
          • 36541
          • 222 Posts
          1) Do not use Rich Text Editor!
          2) Use empty document template.

          If you don’t provide ’sitemap.xsl’ you will get a blank document or an error when using browser. However, the sitemap is valid and it is fetched by Google. Google bot doesn’t need the XSL stylesheet.

          If you provide ’sitemap.xsl’ and access it with Mozilla/FireFox than you have to add the following code to the ’.htaccess’ file in the root of your site:

           # Mozilla requires this to handle XSL stylesheets
          AddType application/xml .xsl
          


          I am working on a more thorough documentation for the SiteMap snippet and sitemap in general. It is still a work-in-progress, but you might want to take a look at it. It can be found in MODx wiki: http://wiki.modxcms.com/index.php/SiteMap:_Google_sitemaps_in_MODx
            This is the web: the only thing you know about who will come is that you don't know who will come.
            • 14779
            • 256 Posts
            Hey grad!
            I edited the .htaccess file.
            Now This:

            XML Parsing Error: junk after document element
            Location: http://heav.org/sitemap.xsl
            Line Number 26, Column 1:
            <h1 id="head1">Google Sitemap</h1>
            ^

            The site map works fine, and I don’t really need to get this working, but it would be nice...
              PM me to find out how you can get a FREE ipad 2!
              • 36541
              • 222 Posts
              Quote from: joshlfisher at Oct 27, 2006, 04:11 PM

              Now This:
              XML Parsing Error: junk after document element
              Location: http://heav.org/sitemap.xsl
              Line Number 26, Column 1:
              <h1 id="head1">Google Sitemap</h1>

              Strangely your stylesheet is version 1.4 while mine is 1.5a. Looks like the source at www.baccoubonneville.com is not up to date. Try the version 1.5a from http://enarion.net/google/sitemaps/stylesheet/#download. This is the one I am using and it works fine.

              I updated the download info in resource page and wiki.
                This is the web: the only thing you know about who will come is that you don't know who will come.
                • 36541
                • 222 Posts
                Full documentation for this snippet is available in MODx wiki article SiteMap: Google sitemaps in MODx.
                  This is the web: the only thing you know about who will come is that you don't know who will come.
                  • 4643
                  • 34 Posts
                  Hi!
                  OK, I got it working with XSL stylesheet and all. Very neat thanks!

                  Here’s a small problem (annoyance); I get the sitemap.xml itself listed in the sitemap + the javascript file and XSL stylesheet as well. I have tried to get rid of them from there by putting this in my sitemap.xml:

                  [!SiteMap? &format=`sp` &excludeTemplates=`blank, folder`!]

                  The sitemap.xml and my javascript and XSL files are all based on the standard blank template. The other template (folder) is one I have for folders and I don’t want them listed.

                  It works for my folders - they were listed before but after changing to the above call, they are not anymore. Just the way I want it. But all files based on the blank template ARE listed. The blank template seems to be a system template - I can’t use a TV to exclude files like my javascripts etc because the TV definition does not allow it to be used with this template, it is not listed among the choices.

                  Also, the blank template is actually listed as "(blank)", I have tried using the brackets as well in the SiteMap call but none of these two versions works. I also tried to define an empty template and apply to my sitemap et al but that didn’t work at all, apparently they need to use the system (blank) template.

                  Any clues?
                    • 36541
                    • 222 Posts
                    Quote from: carlotto at Oct 29, 2006, 05:58 PM

                    I get the sitemap.xml itself listed in the sitemap + the javascript file and XSL stylesheet as well.

                    You don’t need external JavaScript with version 1.5a of the XSL stylesheet. It has the JS embedded.

                    Quote from: carlotto
                    The sitemap.xml and my javascript and XSL files are all based on the standard blank template.

                    The blank template seems to be a system template - I can’t use a TV to exclude files like my javascripts etc because the TV definition does not allow it to be used with this template, it is not listed among the choices.

                    I also tried to define an empty template and apply to my sitemap et al but that didn’t work at all, apparently they need to use the system (blank) template.

                    The system blank template, from what I found, means in fact a lack of template. It doesn’t show on the list of templates. You have to make one yourself and use it for documents you want to exclude. Just create a new template and put ’[*content*]’ into it. Of course, do not use RTE. Then use its name in the snippet call.

                    It works for me. Should work for you, I hope.
                      This is the web: the only thing you know about who will come is that you don't know who will come.
                      • 4643
                      • 34 Posts
                      Hi!

                      Thanks for the info & tips! I’ve played around with 1.4 and 1.5a and the use of an "empty" template for different files so I can control their appearance (or disappearance) in the sitemap. There are many little quirks though, here’s what I’ve stumbled on so far;


                      Viewing sitemap while logged on as manager does not work
                      -----------------------------------------------

                      I had a lot of errors like this (applies for both stylesheets 1.4 and 1.5a):

                      "Error during XSLT transformation: An unknown XPath extension function was called."

                      I’m using Firefox, so I followed the advice in the Wiki and added this:

                      "AddType application/xml .xsl"

                      to the .htaccess.

                      I added it just in case, but sitemap is still quirky. I can access the sitemap, but only if I am NOT logged on to the manager interface. As soon as I have a cookie set from the manager logon, I’m back to the above error. This is not a big issue, I can just make sure I have no cookie there when I need to see the sitemap.

                      Trying IE6 instead, I get a similar result. I can access the sitemap fine as long as I haven’t logged on to the manager first. If I log on to the manager first and then access the sitemap, I get this error:

                      ---
                      Line: 88
                      Char: 15
                      Error: Object required
                      Code: 0
                      URL: http://www.mysite.com/sitemap.xml
                      ---

                      I tried to kill cookies etc in IE6 but no amount of killing cookies, files, cache etc helps. Closing IE completely and
                      starting with a "fresh" IE, accessing the sitemap will work though.


                      Excluding CSS files, Javascript files etc from the sitemap
                      --------------------------------------------

                      Adding the [*content*] to my own "empty" template did it for CSS files, thanks for that tip! I didn’t realise I had to have [*content*] there, I first simply made a (totally) empty template, then made a CSS file based on that. But that does not work, no CSS is applied in that case (mentioning it here as a reference in case anyone else tries this).

                      However - for the sitemap.xml and sitemap.xsl (just a renamed 1.5a gss.xsl), I get a strange "extra" listing for the homepage (the others are fine):

                      SITEMAP URL Last modification date
                      http://www.mysite.com// 1969-12-31

                      There is also a line for http://www.mysite.com/index.html, with the correct date and not with the double //.

                      This seems to be the case whether I use my new "empty" template or the (blank) system template - it seems to be a problem in the 1.5a sitemap.xsl file. I have changed back to the 1.4 version (+ CSS file + Javascript file) and the extra site line has disappeared again. With the new "empty" template I can at least get rid of the sitemap listing for all the CSS files and the Javascript file - remaining now is only the sitemap.xml and sitemap.xsl.

                      I wouldn’t mind getting it all in one file as intended in the 1.5a though so I’m grateful for any tips and ideas here.