制作一个简单的joomla模板 joomla模板制作教程

制作一个简单的joomla模板


在templates文件夹下创建一个新的文件建。给这个文件夹命名,例如mynewtemplate
使用编辑工具创建(推荐Notepad++)index.php和templateDetails.xml两个文件,创建名为images和css的两个文件夹,这两个文件夹分别用来放至图片和CSS文件,当然你也可以将图片和CSS文件直接放在mynewtemplate文件夹下,
templateDetails.xml文件是必不可少的,没有这个文件,joomla将看不到你的模板,下面是一个templateDetails.xml文件的例 子
<?xml version="1.0"encoding="utf-8"?>
<!DOCTYPE install PUBLIC "-//Joomla! 1.5//DTDtemplate 1.0//EN"
""rel="nofollow">http://dev.joomla.org/xml/1.5/template-install.dtd">
<install version="1.5"type="template">
<name>mynewtemplate</name>
<creationDate>2008-05-01</creationDate>
<author>JohnDoe</author>
<authorEmail>john@example.com</authorEmail>
<authorUrl>http://www.example.com</authorUrl>
<copyright>John Doe2008</copyright>
<license>GNU/GPL</license>
<version>1.0.2</version>
<description>My NewTemplate</description>
<files>
<filename>index.php</filename>
<filename>component.php</filename>
<filename>templateDetails.xml</filename>
<filename>template_thumbnail.png</filename>
<filename>images/background.png</filename>
<filename>css/style.css</filename>
</files>
<positions>
<position>breadcrumb</position>
<position>left</position>
<position>right</position>
<position>top</position>
<position>user1</position>
<position>user2</position>
<position>user3</position>
<position>user4</position>
<position>footer</position>
</positions>
</install>
正如你所看到的,你可以通过标签设置模板的信息
index.php是模板的核心文件,它提供了网站页面的输出
下面通常作为index.php文件的开头
<?php defined( '_JEXEC' ) or die( 'Restrictedaccess' );?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0Transitional//EN"
""rel="nofollow">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; ?>">
第一行可以阻止别人看到你的文件代码
第二行告诉浏览器你页面的各类
第三行是你网站的语言
随后通常是header代码
<head>
<jdoc:include type="head" />
<link rel="stylesheet" href="<?phpecho $this->baseurl?>/templates/system/css/system.css" type="text/css"/>
<link rel="stylesheet" href="<?phpecho $this->baseurl?>/templates/system/css/general.css" type="text/css"/>
<link rel="stylesheet" href="<?phpecho $this->baseurl?>/templates/<?php echo$this->template?>/css/style.css"type="text/css" />
</head>
第一行将导入joomla的header信息,剩下的是导入CSS和JS文件。
现在开始网站的body

<body>
<jdoc:include type="modules" name="top"/>
<jdoc:include type="component"/>
<jdoc:include type="modules" name="bottom"/>
</body>
这是最基本的网站布局
最后,加上</html>

完整的index.php代码
<?php defined( '_JEXEC' ) or die( 'Restrictedaccess' );?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0Transitional//EN"
""rel="nofollow">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="<?phpecho $this->baseurl?>/templates/mynewtemplate/css/style.css"type="text/css" />
</head>
<body>
<jdoc:include type="modules" name="top"/>
<jdoc:include type="component"/>
<jdoc:include type="modules" name="bottom"/>
</body>
</html>

  

爱华网本文地址 » http://www.413yy.cn/a/25101014/219554.html

更多阅读

一个简单的PS修片方法 ps简单方法换成白背景

以前看人家照片照的好,总问,PS了吗?被问的人总是不大高兴,认为污辱了自己的摄影水平其实水平再高的人,尤其是给孩子拍照,也不可能保证每张都是佳片,很多时候看宝贝儿表情很好,拿起相机一照,相机里没设置好,出的片子效果不满意,等调好了再拍,又

一个简单的方法——防止电脑感染病毒图 防止手术感染的方法

这篇文章是我自己经验的总结,放在这里,也许可以帮助对电脑不熟悉的网友,减少甚至避免今后在网络上受到病毒袭击。如果文中有错误或者值得改进之处,欢迎各位提出——xyh一个简单的方法——防止电脑感染病毒我们常常遇到这样的问题,就是新

声明:《制作一个简单的joomla模板 joomla模板制作教程》为网友正能量的女神分享!如侵犯到您的合法权益请联系我们删除