<![CDATA[ Can't remove doctype from the empty MODX template - My Forums]]> https://forums.modx.com/thread/?thread=104983 <![CDATA[Can't remove doctype from the empty MODX template]]> https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template?page=2#dis-post-564493
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?

]]>
unzart Mar 19, 2019, 11:58 AM https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template?page=2#dis-post-564493
<![CDATA[Re: Can't remove doctype from the empty MODX template]]> https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template#dis-post-564529 Quote from: andytough at Mar 21, 2019, 08:08 AM
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

Thanks for your help, Andy.
But I guess I leave the plugin Adaptive image uninstalled, cuz I dont want it to cause any new problems.]]>
unzart Mar 21, 2019, 08:34 AM https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template#dis-post-564529
<![CDATA[Re: Can't remove doctype from the empty MODX template (Best Answer)]]> https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template#dis-post-564528
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]]>
andytough Mar 21, 2019, 08:08 AM https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template#dis-post-564528
<![CDATA[Re: Can't remove doctype from the empty MODX template (Best Answer)]]> https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template#dis-post-564527 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.]]>
unzart Mar 21, 2019, 07:36 AM https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template#dis-post-564527
<![CDATA[Re: Can't remove doctype from the empty MODX template]]> https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template#dis-post-564516
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?

]]>
andytough Mar 20, 2019, 08:17 PM https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template#dis-post-564516
<![CDATA[Re: Can't remove doctype from the empty MODX template]]> https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template#dis-post-564515 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.]]>
unzart Mar 20, 2019, 07:12 PM https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template#dis-post-564515
<![CDATA[Re: Can't remove doctype from the empty MODX template]]> https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template#dis-post-564511
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.]]>
andytough Mar 20, 2019, 04:46 PM https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template#dis-post-564511
<![CDATA[Re: Can't remove doctype from the empty MODX template]]> https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template#dis-post-564509 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]]>
unzart Mar 20, 2019, 03:14 PM https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template#dis-post-564509
<![CDATA[Re: Can't remove doctype from the empty MODX template]]> https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template#dis-post-564508 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.]]>
unzart Mar 20, 2019, 03:13 PM https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template#dis-post-564508
<![CDATA[Re: Can't remove doctype from the empty MODX template]]> https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template#dis-post-564497 BobRay Mar 19, 2019, 09:22 PM https://forums.modx.com/thread/104983/can-t-remove-doctype-from-the-empty-modx-template#dis-post-564497