The <code><jdoc:include /></code> statement is a Joomla! template's method of displaying content specific to the page being viewed. There are various <code><jdoc:include /></code> statements, each returning a different part of a Joomla! page.

+

The <code><jdoc:include /></code> statement is a Joomla! template's method of displaying content specific to the page being viewed. There are various <code><jdoc:include /></code> statements, each returning a different part of a Joomla! page. The replacement itself is done in JDocumentHTML::_renderTemplate. See also _parseTemplate.

−

== The type attribute ==

+

=== The type attribute ===

−

The <tt>type</tt> attribute specifies the type of content to be rendered in place of the <code><jdoc:include /></code> element. For example, the <code><jdoc:include '''''type="head"''''' /></code> statement uses the <code>type</code> attribute <code>head</code> (<code>type="head"</code>)

+

The <tt>type</tt> attribute specifies the type of content to be rendered in place of the <code><jdoc:include /></code> element. For example, the <code><jdoc:include '''''type="head"''''' /></code> statement uses the <code>type</code> attribute <code>head</code> (<code>type="head"</code>). (''Note: Jdoc expressions require double quotes around attributes, and won't work with single quotes.'')

−

=== Component ===

+

==== Component ====

<source lang="html4strict">

<source lang="html4strict">

<jdoc:include type="component" />

<jdoc:include type="component" />

Line 14:

Line 13:

This element should only appear once in the <body> element of the Template to render the main content of the page with respect to the current page being viewed.

This element should only appear once in the <body> element of the Template to render the main content of the page with respect to the current page being viewed.

−

=== Head ===

+

==== Head ====

<source lang="html4strict">

<source lang="html4strict">

<jdoc:include type="head" />

<jdoc:include type="head" />

Line 21:

Line 20:

This element should only appear once in the <head> element of the Template to render the content of the style, script and meta elements associated with the current page.

This element should only appear once in the <head> element of the Template to render the content of the style, script and meta elements associated with the current page.

−

=== Installation ===

+

==== Installation ====

<source lang="html4strict">

<source lang="html4strict">

<jdoc:include type="installation" />

<jdoc:include type="installation" />

</source>

</source>

−

This element is only used within the Joomla! Installer template and of no particular use in a Front-end or Back-end template. It's somewhat the equivalent to the 'component' type, rendering the main content of an installation step.

+

This element is only used within the Joomla! Installer template for Joomla {{JVer|2.5}} and below and is of no particular use in a Front-end or Back-end template. It's somewhat the equivalent to the 'component' type, rendering the main content of an installation step.

−

=== Message ===

+

==== Message ====

<source lang="html4strict">

<source lang="html4strict">

<jdoc:include type="message" />

<jdoc:include type="message" />

Line 37:

Line 36:

CSS styles for system messages can be found in templates\system\css\system.css

CSS styles for system messages can be found in templates\system\css\system.css

This element renders a single module given by the <tt>name</tt> attribute. The module in question must be published and accessible by the current user in order to become visible. Additional attributes can be provided to control the layout and appearance of the module, if supported.

+

This element renders a single module given by the <tt>name</tt> and <tt>title</tt> attributes: <tt>name</tt> should match module type (mod_breadcrumbs and mod_menu in the examples above) while <tt>title</tt> should be the module name of the desired module.

+

The module in question must be published and accessible by the current user in order to become visible. Additional attributes can be provided to control the layout and appearance of the module, if supported.

−

=== Modules ===

+

==== Modules ====

Modules are rendered on a page using one of the following code examples. The modules are separated into different areas of a template using template positions set in the <code>templatedetails.xml</code> file. Using the <code>jdoc:include</code>'s <code>name="''[template position name]''"</code> attribute, the various modules in their respective positions can be called, rendered, and styled separately. Additional attributes can be provided to control the layout and appearance of modules, if supported.

Modules are rendered on a page using one of the following code examples. The modules are separated into different areas of a template using template positions set in the <code>templatedetails.xml</code> file. Using the <code>jdoc:include</code>'s <code>name="''[template position name]''"</code> attribute, the various modules in their respective positions can be called, rendered, and styled separately. Additional attributes can be provided to control the layout and appearance of modules, if supported.

Line 70:

Line 69:

'''Note:''' The <code>name="user3"</code> module position is normally (by default) used for the top menu.

'''Note:''' The <code>name="user3"</code> module position is normally (by default) used for the top menu.

−

==== The style attribute ====

+

=== The style attribute ===

The optional <code>style=""</code> attribute is available for the <code>module</code> and <code>modules</code> types of <code><jdoc:include /></code> statements. The attribute value refers to the [[What is module chrome?|chrome]] style used to wrap the output generated by the Module. If no style is provided, a value of "<code>none</code>" is used by default.

The optional <code>style=""</code> attribute is available for the <code>module</code> and <code>modules</code> types of <code><jdoc:include /></code> statements. The attribute value refers to the [[What is module chrome?|chrome]] style used to wrap the output generated by the Module. If no style is provided, a value of "<code>none</code>" is used by default.

Revision as of 23:40, 29 September 2013

<translate> jdoc statements are included in every Joomla template and indicate where the output from other parts of Joomla or its extensions should be positioned in the overall web page. A typical jdoc statement looks like this: <jdoc:include type="component" /></translate>

Contents

jdoc:include

The <jdoc:include /> statement is a Joomla! template's method of displaying content specific to the page being viewed. There are various <jdoc:include /> statements, each returning a different part of a Joomla! page. The replacement itself is done in JDocumentHTML::_renderTemplate. See also _parseTemplate.

The type attribute

The type attribute specifies the type of content to be rendered in place of the <jdoc:include /> element. For example, the <jdoc:include type="head" /> statement uses the type attribute head (type="head"). (Note: Jdoc expressions require double quotes around attributes, and won't work with single quotes.)

Component

<jdoc:include type="component"/>

This element should only appear once in the <body> element of the Template to render the main content of the page with respect to the current page being viewed.

Head

<jdoc:include type="head"/>

This element should only appear once in the <head> element of the Template to render the content of the style, script and meta elements associated with the current page.

Installation

<jdoc:include type="installation"/>

This element is only used within the Joomla! Installer template for Joomla and below and is of no particular use in a Front-end or Back-end template. It's somewhat the equivalent to the 'component' type, rendering the main content of an installation step.

Message

<jdoc:include type="message"/>

This element should only appear once in the <body> element of the Template to render system and error messages that occurred in the request.

CSS styles for system messages can be found in templates\system\css\system.css

Module

This element renders a single module given by the name and title attributes: name should match module type (mod_breadcrumbs and mod_menu in the examples above) while title should be the module name of the desired module. The module in question must be published and accessible by the current user in order to become visible. Additional attributes can be provided to control the layout and appearance of the module, if supported.

Modules

Modules are rendered on a page using one of the following code examples. The modules are separated into different areas of a template using template positions set in the templatedetails.xml file. Using the jdoc:include's name="[template position name]" attribute, the various modules in their respective positions can be called, rendered, and styled separately. Additional attributes can be provided to control the layout and appearance of modules, if supported.

Below are some examples of module statements with module positions used frequently by Joomla! theme developers.

Note: The name="user3" module position is normally (by default) used for the top menu.

The style attribute

The optional style="" attribute is available for the module and modules types of <jdoc:include /> statements. The attribute value refers to the chrome style used to wrap the output generated by the Module. If no style is provided, a value of "none" is used by default.