We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 54958
    • 6 Posts
    I'm trying to use the Sitemap from the plugin SEOTAB for my website. I followed the guide as told:

    You have to manually create a resource within MODX, Template: (empty). go to the tab Settings and set Content Type: XML, Cachable and Rich Text should be ticked off. In the content field, use the following code: [[!StercSeoSiteMap]]

    Problem is, even though I used the empty MODX template for that resource, it puts the doctype in automatically. So the page does not work.
    If you look in the source code of my page, you can see it here: view-source:https://storyanalyse.de/sitemaps.xml

    I have the same problem when I try to create an rss feed. There's always the doctype in it and thus makes the page not work.

    Does anyone know why that happens? How I can make it work?

    This question has been answered by multiple community members. See the first response.

      • 38783
      • 571 Posts
      Choosing (empty) as the template for the page should work.

      If you previously used a template other than (empty) you might need to clear the site cache.
        If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

        email: [email protected] | website: https://andytough.com
        • 3749
        • 24,544 Posts
        If you re-edit the page, has the template changed? When you change the template, the page reloads, but the template change isn't permanent until you "Save" the resource.
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 54958
          • 6 Posts
          Quote from: andytough at Mar 19, 2019, 12:31 PM
          Choosing (empty) as the template for the page should work.

          If you previously used a template other than (empty) you might need to clear the site cache.

          Thank you for your answer, Andy.
          I can change the template to another one that's empty and clear site cache, browser cache and core cache and I still have the same problem. It just always puts the doctype before.
            • 54958
            • 6 Posts
            Quote from: BobRay at Mar 19, 2019, 09:22 PM
            If you re-edit the page, has the template changed? When you change the template, the page reloads, but the template change isn't permanent until you "Save" the resource.

            Thanks for your reply, Bob. The resource is saved with the empty template, but still the same problem as seen in the source code here: https://storyanalyse.de/sitemaps.xml
              • 38783
              • 571 Posts
              It is interesting that the declaration is not the same as all the other pages on your site.

              sitemaps.xml
              <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">


              Other pages
              <!DOCTYPE html>


              You could try making a new template called 'none' that has no content. Use the new 'none' template for the .xml pages and clear the cache again.
                If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

                email: [email protected] | website: https://andytough.com
                • 54958
                • 6 Posts
                Quote from: andytough at Mar 20, 2019, 04:46 PM
                It is interesting that the declaration is not the same as all the other pages on your site.

                sitemaps.xml


                Other pages

                Because in the other template I put the doctype declaration in myself. Nowhere on my entire site did I use:
                <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">


                So I have no idea where that line comes from.

                Quote from: andytough at Mar 20, 2019, 04:46 PM
                You could try making a new template called 'none' that has no content. Use the new 'none' template for the .xml pages and clear the cache again.

                I have tried it that way several times, but as soon as i have an empty template and put content in the content tab, it automatically puts in that doctype line. And it's not just on that website, i have two other pages too, that have the same problem with the doctype line that i cannot get rid of.

                Thanks for your help so far.
                  • 38783
                  • 571 Posts
                  Is it possible that you have a snippet or plugin on the site that is performing an action on pages as or before they are rendered?

                  https://docs.modx.com/revolution/2.x/developing-in-modx/basic-development/plugins/system-events/onwebpageprerender


                  • OnWebPagePrerender
                  • OnWebPageComplete
                  • OnWebPageInit

                  Could you post a list of extras / plugins installed on the site?

                    If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

                    email: [email protected] | website: https://andytough.com
                  • discuss.answer
                    • 54958
                    • 6 Posts
                    Quote from: andytough at Mar 20, 2019, 08:17 PM
                    Is it possible that you have a snippet or plugin on the site that is performing an action on pages as or before they are rendered?

                    https://docs.modx.com/revolution/2.x/developing-in-modx/basic-development/plugins/system-events/onwebpageprerender


                    • OnWebPagePrerender
                    • OnWebPageComplete
                    • OnWebPageInit

                    Could you post a list of extras / plugins installed on the site?


                    Thanks for your tip for looking at the extras / plugins.

                    Here's the list:

                    • Ace
                    • Adaptive Image
                    • Ajax Form
                    • Collections
                    • fastField
                    • FormIt
                    • Gallery
                    • getDate
                    • getResources
                    • LudwigShariff
                    • MIGX
                    • MinifyHTML
                    • pdoTools
                    • PiwikVisitsSummary
                    • pThumb
                    • Redirector
                    • Resizer
                    • SEO Pro
                    • SimpleSearch
                    • simpleUpdater
                    • SEO Tab
                    • tagElement Plugin
                    • Tagger
                    • TinyMCE Rich Text Editor
                    • TweetThis MODX

                    I know that the plugin Adaptive Image caused problems before, so I uninstalled that plugin.
                    Without it, there's no more doctype that's put in my empty template. So the sitemap works now.

                    Is there a way to use adaptive image and still have the SEO Tab Sitemap?

                    Thank you, Andy.
                    • discuss.answer
                      • 38783
                      • 571 Posts
                      I am glad it is working now.

                      I think you might be able to use it if you could restrict its access to certain templates.

                      It looks like I asked how to do this to another plugin a while ago. See Bruno's answer in the following post. I did not try what he suggested as I went down a different route, but you could give it a go.

                      https://forums.modx.com/thread/102663/associate-plugin-with-a-specific-template
                        If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

                        email: [email protected] | website: https://andytough.com