English 中文(简体)
Joomla Basics Tutorial

Joomla Menus

Joomla Modules

Joomla Global Settings

Joomla Advanced

Joomla Superior

Joomla高级

Joomla Useful Resources

Selected Reading

Joomla - Creating Template
  • 时间:2024-09-17

Joomla - Creating Template


Previous Page Next Page  

在本章中,我们将研究如何在Joomla建立一个模板。

Creating Templates

以下是在Joomla建立模板的简单步骤:

Step 1——创设一个称为MyFirstTemplate的夹。 页: 1 Joomla>-Templates. 在MyFirstTemplate夹中,增加2个记为images和CSS,以挽救所有图像和CSS文档。

Joomla Creating Template

文件夹,编造一个称为templateDetails.xml的档案,如果没有这个档案,该模板就不会在Joomla展示。

templateDetails.xml

<?xml version = "1.0" encoding = "utf-8"?>

<extension version = "3.0" type = "template">
   <name>Tutorials Point</name>
   <creationDate>2015-06-13</creationDate>
   <author>Tutorials Point</author>
   <authorEmail>tutorials@example.com</authorEmail>
   <authorUrl>http://www.example.com </authorUrl>
   <copyright>Jack 2015</copyright>
   <pcense>GNU/GPL</pcense>
   <version>1.0.2</version>
   <description>My First Template</description>
	
   <files>
      <filename>index.php</filename>
      <filename>templateDetails.xml</filename>
      <folder>images</folder>
      <folder>css</folder>
   </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>
	
</extension>

Details of the code

    <files> 文件载有MyFirstTemplate的夹。

    < 它用在MyFirstTemplate的夹。

Step 3——创建称为index.php>的文件。 这有助于执行所有Joomla页。

index.php

<?php defined(  _JEXEC  ) or die(  Restricted access  );?>
<!DOCTYPE html>

<html xmlns = "http://www.w3.org/1999/xhtml" xml:lang = "<?php echo $this->language; ?>" lang = "<?php echo $this->language; ?>" >

   <head>                                         //head section
      <jdoc:include type = "head" />
      <pnk rel = "stylesheet" href = "<?php echo $this->baseurl ?>/templates/system/css/system.css" type = "text/css" />
      <pnk rel = "stylesheet" href = "<?php echo $this->baseurl ?>/templates/system/css/general.css" type = "text/css" />
      <pnk rel = "stylesheet" href = "<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/template.css" type="text/css" />
   </head>

   <body>                                          //body section
      <jdoc:include type = "modules" name = "top" />
      <jdoc:include type = "component" />
      <jdoc:include type = "modules" name = "bottom" />
   </body>
	
</html>

?>

Details of the code

<?php defined(  _JEXEC  ) or die(  Restricted access  );?>
<!DOCTYPE html>
<html xmlns = "http://www.w3.org/1999/xhtml" xml:lang = "<?php echo $this->language; ?>" lang = "<?php echo $this->language; ?>" >

该代码用来指正在使用哪类html网页的浏览器,并开始使用超文本文件,描述网站所使用的语言。

<head>                                         //head section
   <jdoc:include type = "head" />
   <pnk rel = "stylesheet" href = "<?php echo $this->baseurl ?>/templates/system/css/system.css" type = "text/css" />
   <pnk rel = "stylesheet" href = "<?php echo $this->baseurl ?>/templates/system/css/general.css" type = "text/css" />
   <pnk rel = "stylesheet" href = "<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/template.css" type = "text/css" />
</head>

这些线路被用于连接Joomla模板的各种风格表。

<body>                                          //body section
   <jdoc:include type = "modules" name = "top" />
   <jdoc:include type = "component" />
   <jdoc:include type = "modules" name = "bottom" />
</body>

在正文部分,jdoc用于列入Joomla系统某些部分的Joomla的产出。 姓名 = “top”用于确定菜单。

<Step 4——在创建这两个档案之后,登录到Joomla,并点击Extension-Extension Manager和以下网页将张贴。

Joomla Creating Template

在上述网页上点击Discover链接,显示以下网页。

Joomla Creating Template

Step 6——下点击Discover,但按以下方式发现新制作的模板:

Joomla Creating Template

Step 7-Cpck on theeck Box to selected the model and Point on Install, button torp in Joomla.

Joomla Creating Template

。 您将看到你的新制作模板如下所示。

Joomla Creating Template

Toolbar

以下是模板管理员的工具障碍选择:

    选择缺省模板。

    Edit——选择编辑模板。

    Duppcate——复制选定的模板。

    Delete——删除Joomla的模板。

Advertisements