Create a DocType XML
A design intended to be viewed using HTML 5 will not look correct if rendered using the XHTML or HTML 4 specification. You can force the theme to be rendered in XHTML or HTML5 by creating a DocType XML file (skin.doctype.xml), which is applied to all layouts in the theme. In addition, themes can contain a separate DocType file for any individual layout template to override the theme's DocType declaration.
Note
By default, DNN uses the HTML 4.0 Transitional DocType (<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
), if no Theme DocType is specified. But this Fallback doctype can be changed.
Note
In DNN 8 you can set the Fallback DocType via Host > Host Settings.
Note
In DNN 9 there's currently no interface for this, but you can create or edit a record in the "HostSettings" table. SettingName: 'DefaultDocType' / SettingValue: 3, will set the Fallback Doctype to HTML5.
Steps
Create a DocType XML file.
- If the DocType is for the entire theme, the file must be named skin.doctype.xml.
- If the DocType is for a specific layout template, the file must have the same name as your layout template file, followed by .doctype.xml.
If your layout template file is called MyAwesomeLayout.html, its specific DocType file must be named MyAwesomeLayout.doctype.xml.
Enter the appropriate code in your DocType file.
HTML5
<SkinDocType> <![CDATA[<!DOCTYPE html>]]> </SkinDocType>
XHTML Strict
<SkinDocType> <![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">]]> </SkinDocType>
XHTML Transitional
<SkinDocType> <![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">]]> </SkinDocType>
HTML 4.01 Transitional
<SkinDocType> <![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">]]> </SkinDocType>