We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26931
    • 2,314 Posts
    I can’t get excludeTV to work
    ...couldn’t exclude documents using their IDs in "&excludeTemplates" (according to the snippet documentation it should work in version 1.0.8 ) so i ended up using the TV-version which works perfectly:

    for your TV "sitemap_exclude" choose

    Input Type: Radio Options
    Input Option Values: show in sitemap==0||don’t show in sitemap==1
    Default Value: 0

    and assign it to your Template via "Template Access"

    hope that helps smiley
      • 10190
      • 187 Posts
      Thanks, that did the job - so it’s radio buttons, not check boxes!

      Cheers
      Frisco
        • 3285
        • 5 Posts
        Hi,

        I installed following http://wiki.modxcms.com/index.php/SiteMap:_Google_sitemaps_in_MODx#Step-by-step:_How_to_create_a_Google_sitemap_in_MODx_using_SiteMap_snippet.3F

        sitemap.xml is not created though.

        When I preview the page in ModX, I see the sitemap.
        I checked permissions, user www-data has rw permissions.

        Please advice.

        -Bart
          • 3285
          • 5 Posts
          Stupid question, think it was too early for me.

          -Bart
            • 10313
            • 375 Posts
            So, now it’s me too, who receives the fatal error:

            Fatal error: Call to undefined function getDocs() in /var/kunden/webs/ahhermann/manager/includes/document.parser.class.inc.php(769) : eval()'d code on line 137


            I’m using Sitemap 1.0.8 with MODx 0.9.6.1p2 (okay, I know it’s old ...).

            I already changed the snippet code so that it already declares the function getTV and getDocs if they are undefined. If I restore the snippet code back to original, I receive the fatal error, that I can’t redeclare the function getTV. So that’s interesting.

            Either it tries to declare it multiple times, or not at all. I can’t understand that.

            Any help very much appreciated smiley
            Thanks
            Martin
              • 10313
              • 375 Posts
              Okay, for me it’s solved now. I have updated to 1.0.0, and now Sitemap works.

              Sorry for bothering.
              Martin
                • 5337
                • 6 Posts
                Does Sitemap have any specific server requirements to do its thing?

                I know I am making them correctly as I have got them working. On one particular server, i.e. the one most of my clients are on, I cannot get a sitemap to list more than the home page. Just made another today - only the home page has been included. They’re pretty basic sites - a handful of pages on one level, all sat in the site root.

                To confirm, I’ve done all the text/xml, blank template, rich text switched off, etc - however I don’t believe any of that is causing the problem as I get the XML output but only including first page of the site.

                I’ve tried a new template including the call in that - same result. Started with
                [!SiteMap? &format=`sp`!]
                and stripped down to
                [!SiteMap!]


                Having done a site on another server because client already had hosting, I’m doing exactly the same thing and using exactly the same snippet source, it is absolutely fine and I have a full sitemap, so this leads me to believe I am missing something.

                Any ideas?

                MODx version 1.0.0
                Version codename rev 5601
                  • 29636
                  • 31 Posts
                  How do i create an html sitemap?

                  kindly help.
                    • 23183
                    • 102 Posts
                    Thanks for this great snippet. I have generated a sitemap no problem, but I can not get the sitemap.xsl to be applied to it.

                    I have created a sitemap.xsl filw with a empty template, copied the required code into it, modified the htacces file, but the style is not applied.

                    I noticed when I looked at the sitemap source code it is not calling the xsl style sheet, this bit is missing in the source:

                    <?xml-stylesheet type="text/xsl" href="sitemap.xsl"?>

                    Anyone know why?

                    Thanks
                      • 12941
                      • 87 Posts
                      I just wanted to post the problems I was having and what I did to solve them to help others who might be experiencing the same thing.

                      Getting the snippet to work as described was fairly simple, I just had to make sure I removed Rich Editor and change the file type on the "Page Settings" tab.

                      I had trouble with the XSL to show up on the sitemap. It didn’t seem to recognize the "sitemap.xsl" document alias. I found 2 solutions.

                      1. Create an actual file called sitemap.xsl and put it in the same directory level as your index.php page and assets folder.
                      2. Add the parameter &xsl=`sitemap.xsl` to your snippet call

                      I’m not sure if #2 did anything, but at either rate, when I did those things it seemed to work. I then tested to see if I could remove the physical file and just use the document in ModX, and that seemed to work.

                      My second problem, was not getting any results to show up. It said "Number of URLs in this Google Sitemap: 0" but when I viewed the source, all of my links were there.

                      After some searching online, I found that I needed to make a change in the code on sitemap.xsl

                      Around line 29, you’ll see the following line:
                      xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.84"


                      Change it to:
                      xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"


                      You may need to refresh a couple times, clear your cache on Modx or your browser in order for it to show up, but it should eventually.