We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29703
    • 217 Posts
    Hello there,

    I’m having difficult validating a new website as doctype strict. The template before entering ModX validated and now it won’t. I think Maxigallery is mostly to blame, but I can’t isolate the problem.

    Any help would be greatly appreciated.

    site = www.windboats.co.uk
    validation results = Here
      • 25663 MODX Staff
      • 12,272 Posts
      Change your Doctype to xhtml transitional and it should validate.
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 29703
        • 217 Posts
        Quote from: rthrash at Mar 10, 2008, 08:39 AM

        Change your Doctype to xhtml transitional and it should validate.
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



        Okay thanks. But how could I validate it as strict?

        I have done other sites as strict and haven’t had an issue.
          • 25663 MODX Staff
          • 12,272 Posts
          Why does it specifically need to be strict?
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 29703
            • 217 Posts
            Quote from: rthrash at Mar 10, 2008, 08:43 AM

            Why does it specifically need to be strict?


            It’s an ego thing.

            edit -> (and the company I work for is building up a portfolio of strict websites)
              • 5091
              • 332 Posts
              There are good reasons to use strict doctype, for one, transitional HTML (4.0) likely to throw the page to quirk mode, thus creating unpredictable problem in IE. If you do XML, you know that well-formedness is very important. To me, using strict doctype makes me care more about my ’standard compliant codes’ and pick up good habit.

              html doctype doesn’t have ’/’ in self-closing, i.e.


              instead of
              ,

              <link href="css/cssfile.css" rel="stylesheet" type="text/css"> instead of <link href="css/cssfile.css" rel="stylesheet" type="text/css" />

                • 29703
                • 217 Posts
                Quote from: chinesedream at Mar 10, 2008, 08:54 AM

                They are good reasons to use strict doctype, for one, transitional HTML (4.0) likely to throw the page to quirk mode, thus creating unpredictable problem in IE. If you do XML, you know that well-formedness is very important. To me, using strict doctype makes me care more about my ’standard compliant codes’ and pick up good habit.

                html doctype doesn’t have ’/’ in self-closing, i.e.


                instead of
                ,

                <link href="css/cssfile.css" rel="stylesheet" type="text/css"> instead of <link href="css/cssfile.css" rel="stylesheet" type="text/css" />

                Thanks, I knew I had a reason for using strict, though I just couldn’t remember undecided

                I am aware that this is why it isn’t validating, it’s just isolating where the culprits are. In my template all the correct formatting is used, it’s just some of the ModX snippets are injecting new stylesheets and other bits and bobs into the new code.

                I just can’t figure out which ones and how to change them huh
                  • 5091
                  • 332 Posts
                  Quote from: thehen at Mar 10, 2008, 08:59 AM


                  I just can’t figure out which ones and how to change them  huh

                  Well, start from the first error by removing the ’/’ after the ’media="screen" ’  :

                  Line 9, Column 114: NET-enabling start-tag requires SHORTTAG YES.

                  ….css" type="text/css" media="screen" />

                  then, removing the same ’/’ in Line 61, 87, 113, 140 and so on... because in html, img src is self-closing.

                  If this is something generated from Maxigallery, then go to the template to look for that ’slash’.

                  Line 278 indicates that the <ul> was not finished, so you should check that out, sometimes it may not be exactly the Line 278 that needs fix, but something above or below.

                  As for Line 294 and the rest of the erroros, I don’t understand why there is "<quickedit:tagline />. If removing the slash doesn’t work, you might remove the entire code altogether as I suspect you might accidentally added this. With my Modx site, if I am logged in, and try validate the page, I can see the <quickedit:xxxx> code; if I am logged out, this code isn’t there in the source.



                    • 27708 MODX Staff
                    • 2,502 Posts
                    Quote from: rthrash at Mar 10, 2008, 08:43 AM

                    Why does it specifically need to be strict?

                    If you are going to be designing websites with web standards then the only reason you should be using Transitional as a doctype is as a transition from a legacy website (read tag soup and font elements) to current standards not so you can get away with using legacy/deprecated code. The intention of transitional was to allow websites to migrate toward web standards without failing outright because they don’t operate in quirks mode or fail when validated.

                    In my personal opinion, there is absolutely no reason for anyone to design a new site using a transitional doctype. Even OS projects should be using strict (ahem...). There are ways to achieve nearly every desirable/usable result using a strict document type. In addition browsers behave in more predictable ways to the strict document type declarations vs the wild west rendering of some transitional pages.

                    One thing is though, that with MODx, most devs are using XHTML 1.0 and XML Compatible elements including self closing tags. I would suggest you either use XHTML 1.0 strict and ensure all the tags that require the / or use a plugin (I think I put one in the forum) to strip all the closing slash using regex and OnWebPagePrerender to take them out just before it gets pushed to the browser.

                    Personally I don’t use XHTML and therefore I do manually rip out the / slashes because I don’t need XML compatible markup and XHTML doesn’t preclude you from making well formed documents if you know what you are doing.
                      Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
                      • 25663 MODX Staff
                      • 12,272 Posts
                      How about target="_blank" on links and clients that don’t want javascript and pages to open in new windows?
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me