Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Using xhtml strict with silverstripe, problem with doctype


Reply


4 Posts   1861 Views

Avatar
CriaturaCreativaStudio

Community Member, 73 Posts

21 August 2008 at 8:05pm

Hello people,

I have a problem here: i developed a new website, based on xhtml strict and css.
Everything went well on the testing phase, the problem that i have now is that i see that, somehow, the CMS overwrittes my DOCTYPE Declaration:

I wanted to use this one:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

All my documents validated correctly, the problem is that the CMS populates this header:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

Is there a way of using a xhtml strict DOCTYPE declaration for my html files?

Any help would be appreciated!

Thank you very much,

Eduardo

Avatar
hendy

Community Member, 2 Posts

21 August 2008 at 8:35pm

Add

<?xml version="1.0" encoding="utf-8"?>

above your DOCTYPE.

Avatar
Willr

Forum Moderator, 5513 Posts

21 August 2008 at 10:04pm

Or turn ContentNegiotator off.. Have a read of our docs on doctypes on the html page - http://doc.silverstripe.com/doku.php?id=html#doctypes it will hopefully explain things

Avatar
CriaturaCreativaStudio

Community Member, 73 Posts

25 August 2008 at 3:45pm

thank you very much!

:)