Actions

Difference between revisions of "DocType header for templates"

From Joomla! Documentation

m (whitespace cleanup)
 
(14 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Current thinking is that XHTML 1.0 Transitional should be used for Joomla! templates.
+
<noinclude><languages /></noinclude>
===Recommended DocTypes===
+
<translate>
{{:Recommended DocTypes|}}
+
<!--T:7-->
===References about DocTypes===
+
Current thinking is that HTML5 should be used for Joomla! templates.<br />
{{:References about DocTypes|}}
+
Set your template to html5 output:
<noinclude>[[Category:Beginners]][[Category:Templates]][[Category:Topics]][[Category:HTML|DocType]][[Category:Template FAQ]]</noinclude>
+
</translate>
 +
<source lang="php">
 +
$doc = JFactory::getDocument();
 +
$doc->setHtml5(true);
 +
</source>
 +
 
 +
<translate>===Recommended DocTypes=== <!--T:2--></translate>
 +
{{:Recommended DocTypes/<translate><!--T:3-->
 +
en</translate>}}
 +
<translate>===References about DocTypes=== <!--T:4--></translate>
 +
{{:References about DocTypes/<translate><!--T:5-->
 +
en</translate>}}
 +
 
 +
<noinclude>
 +
<translate>
 +
<!--T:6-->
 +
[[Category:DocType]]
 +
[[Category:Template Development]]
 +
[[Category:Template Reference]]
 +
</translate>
 +
</noinclude>

Latest revision as of 07:31, 18 August 2015

Other languages:
English • ‎français • ‎Nederlands

Current thinking is that HTML5 should be used for Joomla! templates.
Set your template to html5 output:

	$doc = JFactory::getDocument();
	$doc->setHtml5(true);

Recommended DocTypes

List of recommended DocTypes for different circumstances:

  • HTML5: <!DOCTYPE html>


References about DocTypes

References about recommended DocTypes: