jdoc标签用于声明joomla模板的页面结构,joomla的模板引擎根据jdoc标签输出页面的指定内容.

<jdoc:include type=”component” />
<jdoc:include type=”head” />
<jdoc:include type=”installation” />
<jdoc:include type=”message” />
<jdoc:include type=”module” name=”breadcrumbs” />
<jdoc:include type=”module” name=”submenu” style=”rounded” id=”submenu-box” />
<jdoc:include type=”modules” name=”left” style=”xhtml” />
<jdoc:include type=”modules” name=”right” style=”xhtml” />
<jdoc:include type=”modules” name=”top” style=”xhtml” />
<jdoc:include type=”modules” name=”user1″ style=”xhtml” />

 

type 属性

jdoc:include 元素中的type属性指定要渲染的内容类型,属性值可以是component,head,installation,message,module,modules

component
页面内容主输出部分,在模板页面<body>元素中应该只出现一次。

head
填充当前页的style, script,meta的相关元素,应该在模板的<head>元素中只出现一次。

installation
仅仅在安装模板中有用,在前台和后台的模板中没有用到,某种程度上与 component类型相似,渲染安装步骤中中的一个页面主内容。

message
在模板的<body>元素中只出现一次,填充系统或者报错信息。

module
渲染由name属性指定的单一模块,模块必须是发布的并且当前用户有权访问,还可以有layout以及controller属性。

modules
渲染模板中所有指定名称的模块,模块必须是发布的并且当前用户有权访问,还可以有layout以及controller属性。

style 属性

对于module 和modules 类型,style是一个可选属性,这一属性指定了模块被渲染风格,如果没指定style,默认是none

4 Responses to “joomla 模板制作中的 jdoc 介绍”

 

来自 http://www.cndong.cn/joomla-templates-to-create-the-jdoc-introduction.html

 

 

noticeboard 滚动式公告板组件

                <?php if($this->countModules('notice')): ?>
                    <div class="notice">
                        <jdoc:include type="modules" name="notice"  style="zhiyuan" />
                       </div>
                <?php endif; ?>
这里style="zhiyuan"是模板样式
在 template/zhiyuan/html/module.php文件里有定义
到 template/templateDetails.xml下面看看
在<positions> 里加上 <position>notice</position>

 

 

 

1)<?php if($this->countModules('industrynews')): ?> //industrynews这个是模板
    <div class="industrynews">
        <jdoc:include type="modules" name="industrynews" style="zhiyuan" />//industrynews这个是模板
    </div>
  <?php endif; ?>

这里style="zhiyuan"是模板样式
在 template/zhiyuan/html/module.php文件里有定义
到 template/templateDetails.xml下面看看
在<positions> 里加上 <position>industrynews</position>