欢迎访问成都祈钰瑶科技有限公司!

全国免费服务热线:

18982081108
✕

成都网站设计公司,成都响应式网站设计,成都移动端网站设计,成都网站UI设计

joomla创建模板-创新互联

joomla 模板

创新互联公司是一家专注于做网站、成都网站建设与策划设计,遵化网站建设哪家好?创新互联公司做网站,专注于网站建设十多年,网设计领域的专业建站公司;建站业务涵盖:遵化等地区。遵化做网站价格咨询:18982081108

使用joomla的自带的图标系统,引入如下

$doc = JFactory::getDocument();
$doc->addStyleSheet($this->baseurl.'/media/jui/css/icomoon.css');

使用如下
<span class="icon-joomla" style="font-size:24px;"> </span>
class 指定图标 同时也可以通过style来指定图标的大小

开发自己的模块需要两个主要的文件

index.php
templateDetails.xml

templateDetails.xml 内容如下

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

<extension version="3.8" type="template">
    
    <name>mynewtemplate</name>
    
    <creationDate>2018-9-22</creationDate>
    
    <author>de0</author>
    
    <authorEmail>deest@gmail.com</authorEmail>
    
    <authorUrl>http://www.tex.com</authorUrl>
    
    <copyright>de0 2018</copyright>
    
    <license>GNU/GPL</license>
    
    <version>1.0.2</version>
    
    <description>My New 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>

其中<files>中有两个元素: <filename>与 <folder>,分别定义模块需要引入的文件及子文件夹中的内容;
而<positions>这个元素:在模板中定义有效的模块位置;也就是在模板中可能需要用的模块位置

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>
    
    <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/template.css" type="text/css" />
    
    <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template;?>/css/styles.css" type="text/css" />

</head>

<body>

    <img src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/images/cte.png" alt="Custom image" class="customImage" />



    <jdoc:include type="modules" name="top" />

    <jdoc:include type="component" />

    <jdoc:include type="modules" name="footer" />

</body>

</html>

其中jdoc:include是一个引用申明,指定模板中其它的输出部分,或者为其它扩展指定位置。
jdoc:include type="modules" name=“top 其指定这里放置模块,并为其配置位置名为top
jdoc:include type="component" 这个是类型指定为组件部分,是模板出的的主要部分。一个模板body标签中只能出一次



另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。