英文原文地址:http://joomlatp.com/joomla-1.5-tutorials/4-steps-convert-joomla-1.0-templates-to-1.5.html
新版本的 Joomla 1.5 发布之后,对于那些想要升级到 1.5 而且还要保留原来的 Joomla 1.0 模板的用户来说,首先要面临的问题可能就是模板的转换。其实模板的转换过程很简单,只需要对模板代码稍作修改即可。不过模板修改过程的难易还是取决于您的模板供应商提供的 .php 文件的代码质量。根据我的经验,有些 Joomla 模板的代码看起来会让人抓狂,弄上半天也可能一无所获。
一般情况,标准 1.0 模板4步就可轻松完成到 1.5 的转换:
1. 替换模板中的相应位置代码为以下内容.
<!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; ?>" dir="<?php echo $this->direction; ?>" >
<head>
<jdoc:include type="head" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template.css" type="text/css" />
</head>
2. 替换 Module 有关的代码。
实例:
1.0 代码:<?php mosLoadModules ( 'header', -3 ); ?>
替换为:<jdoc:include type="modules" name="header" style="xhtml" />
3. 替换主体代码 <?php mosMainBody(); ?> 为 <jdoc:include type="component" style="xhtml" />
4. 重命名 模板文件夹下的 /css 文件夹里的 template_css.css 为 template.css