您的位置:首页 > 其它

joomla首页指定单独的模板教程

2009-12-13 08:55 204 查看
首先在/templates/目录下找到当前的模板目录,将index.php 拷贝为home.php和default.php ,然后我们来修改index.php,index.php的代码如下:

<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
function isFrontPage(){
return (JRequest::getCmd('option')=='com_content' && !JRequest::getInt('id'));
}
if(isFrontPage()){
include_once (dirname(__FILE__).DS.'/home.php');
} else {
include_once (dirname(__FILE__).DS.'/default.php');
}
?>


其实就是判断是否在访问首页,如果访问首页,怎包含home.php,否则是默认default.php。

接下来就是按照你自己的意愿来修改home.php。通常保留原来模板的页头部分,而内容部分可以你任意布局。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  include file function access