joomla 什么是jdoc声明?

来源:互联网 发布:远程手机控制软件 编辑:程序博客网 时间:2024/05/21 09:48
jdoc声明是Joomla模板的一个方法(method),用来在页面中输出指定的内容。典型的jdoc声明看上去是这样的:<jdoc:include type="component"/>。不同类型(type)的jdoc声明负责不同的内容输出。
Component:<jdoc:include type="component"/>
这个声明要放在模板的<body></body>中,并且只能出现一次;它负责输出当前页面的主要内容(maincontent)。
Head:<jdoc:includetype="head" />
这个声明要放在模板的<head></head>中,并且只能出现一次;它负责输出当前页面的样式表链接、脚本链接、meta信息等内容。
Installation:<jdoc:include type="installation"/>
这个类型的jdoc声明只用于Joomla的安装器模板(Installertemplate)中,与Component类型相似,它只负责输出安装过程中页面上的主要内容。
Message:<jdoc:includetype="message" />
message声明要放在模板的<body></body>中,并且只能出现一次,用于输出操作过程中的系统提示信息或出错信息。
Module
<jdoc:includetype="module" name="breadcrumbs" />
<jdoc:includetype="module" name="menu" />
<jdoc:includetype="module" name="submenu" style="rounded" id="submenu-box"/>
module类型的jdoc声明会根据其name属性输出对应的模块,但该模块内容是否会呈现在页面上则取决于用户是否发布激活了该模块;我们可以为其设定style属性来控制模块输出模式;可参见“Joomla文档中文翻译- 原生模块结构(module chrome)类型及对应的HTML输出”。
Modules
modules类型的jdoc声明用来在当前位置调用某个模板位置(templateposition)的所有模块;所有的模板位置都需要预先在templatedetails.xml文件中定义。我们同样可以为其设定style属性来控制模块的输出模式。下面是是一些Joomla模板中常见的modules类型的jdoc声明:
<jdoc:includetype="modules" name="debug" />
<jdoc:includetype="modules" name="icon" />
<jdoc:includetype="modules" name="left" style="rounded" />
<jdoc:includetype="modules" name="left" style="xhtml" />
<jdoc:includetype="modules" name="right" style="xhtml" />
<jdoc:includetype="modules" name="status" />
<jdoc:includetype="modules" name="syndicate" />
<jdoc:includetype="modules" name="title" />
<jdoc:includetype="modules" name="toolbar" />
<jdoc:includetype="modules" name="top" />
<jdoc:includetype="modules" name="top" style="xhtml" />
<jdoc:includetype="modules" name="user1" style="xhtml" />
<jdoc:includetype="modules" name="user2" style="xhtml" />
<jdoc:includetype="modules" name="user3" />
<jdoc:includetype="modules" name="user4" />
原创粉丝点击