2013-04-15 128 views
1

我正在學習如何在的Joomla 2.5創建一個模板,我已經從琳達下面的代碼我當然以下:的Joomla 2.5 HTML5模板

<head> 
<?php 
defined('_JEXEC') or die; 
$app = JFactory::getApplication(); 
?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" > 
<head> 
<jdoc:include type="head" /> 
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" /> 
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" /> 
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/default.css" type="text/css" /> 
</head> 

我想使用HTML5。可我只是換出了XHTML 1.0的文檔類型上面下面的(或我是我缺少別的,包括HTML5?):

<head> 
<?php 
defined('_JEXEC') or die; 
$app = JFactory::getApplication(); 
?> 
<!DOCTYPE html> 
<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" > 
<head> 
<jdoc:include type="head" /> 
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" /> 
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" /> 
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/default.css" type="text/css" /> 
</head> 
+1

你可以交換它,只是它不會驗證id已棄用的標籤正在使用 –

+0

+1謝謝外國人先生 – Anthony

+1

你也不需要'type =「text/css」';) – Lodder

回答

0

爲Joomla 3.2:

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

你可以see。 ..