HTML Question: Get "DOCTYPE" as "strict" and do not want it to be

When I go to my site: http://www.marketswiki.com

I see the following when I view the page’s source (View>Page Source):

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html lang=“en” dir=“ltr”>

One of our web developers says the page is having problems displaying in Internet Explorer (not sure which versions) and has suggested it is the “STRICT” setting in there that is causing the problem.

If you go to: Wikipedia, the free encyclopedia

You get:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html lang=“en” dir=“ltr” xmlns=“XHTML namespace”>

Note in the above it says “Transitional”.

How do I change that?

What does that setting do?

Thanks in advance!

To add:

Looks like this is a DTD (Document Type Definition). Not sure what that is though (despite some reading) or how to change it.

You appear to be running MediaWiki. Therefore you need to edit your configuration to change the value of the $wgDocType variable. Exactly how you do this is highly dependent on your particular installation.

Works just fine in IE 8. If your developer is using IE 7, that’s a problem because 7 was a crap IE browser to begin with.

Don’t write code using IE. Historically IE does not follow web standards so it often vomited, especially with the strict setting. IE 8 is a bit more stable.

Use Firefox, Opera or Chrome. Once you are assured is built to web standards (meaning it should work in the better Tier 1 browsers), then tackle any IE issues.

Thanks but I am unable to discern where that goes. Is it part of the skin I use? Part of LocalSettings?

I have Googled it and there is no suggestion as to where this is meant to be put.

How about from here:

Does that help?

Yes, it’s part of LocalSettings. However, without further information from you we can’t tell you exactly where you find LocalSettings or how to edit it, because this depends on where you installed MediaWiki, and on how you navigate there and launch an editor in your web server’s operating system.

I have access to LocalSettings. No problem there. I’ll give it a shot.

Thanks.

Well, I put:

$wgDocType = “-//W3C//DTD XHTML 1.0 Transitional//EN”;
$wgDTD = “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”;

In the LocalSettings.PHP file and nothing changed.

Back to the drawing board.

If it’s IE6 or IE7, you’ll probably have to do some IE only hacks to the CSS.

http://www.mediawiki.org/wiki/Manual:$wgDocType

Is $wgHtml5 set to true? Seems unlikely.

It says Transitional is the default, what happens if you just comment out the $wgDocType setting?

Or does this help?

http://forums.digitalpoint.com/showthread.php?t=1772984

Maybe you’re editing the wrong copy of LocalSettings.php?

There was no $wgDocType setting at all in the LocalSettings file. When I added it nothing changed (although perhaps I got the syntax wrong).

I definitely have the right file. I edit it on a semi-regular basis as I add extensions and stuff.

I ran a validate on XHTML (WC3 website has it) and used the verbose setting and it told me it was reading a <!DOCTYPE !> which specified the strict setting. Things is when I do a text search on every file in the Wiki it says there is no such string.

I host the site elsewhere and am guessing it is coming from their server. I contacted tech support there and they said they only help with this sort of problem if we have a fully managed (read lots more expensive) account. :rolleyes:

I finally solved this.

What was not very apparent was I had to set html5 to be false to make the other doctype settings stick. It was mentioned upthread but I figured no setting meant it’d default to false (there was no $wgHtml5 setting listed at all). I dunno…all I know is that worked. I put the following in my LocalSettings file which did the trick:

/** The HTML document type. */
$wgHtml5 = false;
$wgDocType = ‘-//W3C//DTD XHTML 1.0 Transitional//EN’;

/** The URL of the document type declaration. */
$wgDTD = ‘http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd’;

/** The default xmlns attribute. */
$wgXhtmlDefaultNamespace = ‘XHTML namespace’;

Thanks for all the help!