Jdoc-Anweisungen
From Joomla! Documentation
jdoc-Anweisungen sind in jedem Joomla template enthalten und geben an, wo die Ausgabe von anderen Teilen von Joomla oder deren Erweiterungen in der gesamten Webseite positioniert werden soll. Ein typisches jdoc-Statement sieht so aus: <jdoc:include type="component" />
jdoc:include
Die <jdoc:include /> Anweisung ist eine Joomla! Template Methode zur Anzeige von Inhalten, die spezifisch für die betrachtete Seite sind. Es gibt verschiedene <jdoc:include /> Anweisungen, die jeweils einen anderen Teil einer Joomla! Seite zurückgeben. Der Austausch selbst erfolgt in JDocumentHTML::_renderTemplate. Siehe auch _parseTemplate.
Das Typ-Attribut
Das Attribut type gibt die Art des zu rendernden Inhalts anstelle des Elements <jdoc:include /> an. Beispielsweise enthält das <jdoc:include ''type="head"''''''''''. /></Anweisung verwendet das type attribute head (type="head"). (Hinweis: Jdoc-Ausdrücke erfordern doppelte Anführungszeichen um Attribute herum und funktionieren nicht mit einfachen Anführungszeichen. Das Leerzeichen vor dem Schließen /> ist ebenfalls obligatorisch'.)
Komponente
<jdoc:include type="component" />
Dieses Element sollte nur einmal im <body> Element der Vorlage erscheinen, um den Hauptinhalt der Seite in Bezug auf die aktuelle Seite darzustellen.
Kopf
<jdoc:include type="head" />
Dieses Element sollte nur einmal im <head> Element der Vorlage erscheinen, um den Inhalt der Stil-, Skript- und Metaelemente der aktuellen Seite darzustellen.
Installation
<jdoc:include type="installation" />
Dieses Element wird nur innerhalb der Joomla! Installer-Vorlage für Joomla
und darunter verwendet und ist in einer Front-end oder Backend-Vorlage nicht besonders nützlich. Es ist in etwa gleichbedeutend mit dem Typ "Komponente", der den Hauptinhalt eines Installationsschrittes wiedergibt.
Nachricht
<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
<jdoc:include type="module" name="breadcrumbs" title="Breadcrumbs" />
<jdoc:include type="module" name="mainmenu" title="Main Menu" />
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.
<jdoc:include type="modules" name="debug" />
<jdoc:include type="modules" name="icon" />
<jdoc:include type="modules" name="left" style="rounded" />
<jdoc:include type="modules" name="left" style="xhtml" />
<jdoc:include type="modules" name="right" style="xhtml" />
<jdoc:include type="modules" name="status" />
<jdoc:include type="modules" name="syndicate" />
<jdoc:include type="modules" name="title" />
<jdoc:include type="modules" name="toolbar" />
<jdoc:include type="modules" name="top" />
<jdoc:include type="modules" name="top" style="xhtml" />
<jdoc:include type="modules" name="user1" style="xhtml" />
<jdoc:include type="modules" name="user2" style="xhtml" />
<jdoc:include type="modules" name="user3" />
<jdoc:include type="modules" name="user4" />
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.
Template designers may add additional chrome names as described in Applying custom module chrome.
See also