• 4/7/2015
  • 2788 Views

Comments

2788 Views

Doctype

Last updated 4 years ago

Comments

Common

(Enter the content of this article below)

Advanced

 
In the context of web pages,the doctype declaration refers to a Document Type Definition (DTD). The DTD specifies the rules for the markup language, so that the browsers can render the content follows the rules of that markup language i.e. different versions of the doctype render content in different ways.

In early versions of DotNetNuke the doctype was a fixed part of default.aspx and was set to "HTML 4.0 Transitional" which was not ideal for sites wanting to create valid XHTML markup. With 4.4, the declaration has been made dynamic, to allow users to declare particular doctypes with particular skins.

To make use of this, you create a file with the same name as your skin except ending in doctype.xml (rather than ascx/htm/html) and it’ll be picked up during skin load. This xml file should contain a single node,SkinDocType, that contains a declaration of your desired doctype. To ensure that the parser reads the value correctly, you need to use a CDATA section to escape out the various < and & characters e.g. If I have a skin called mypage.asx that I intended to render as XHTML 1.0 strict, then I would create a file called mypage.doctype.xml which would contain the following:

XHTML Strict

<SkinDocType><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">]]></SkinDocType>

XHTML Transitional

<SkinDocType><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">">]]></SkinDocType>

HTML 5

<SkinDocType><![CDATA[<!DOCTYPE html>]]></SkinDocType>

Contents
No sections defined
Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out