Template reference material

From Joomla! Documentation
Jump to: navigation, search

Contents

Available jdoc:include types

The following is a complete list of the available jdoc:include types:-

  • component
  • head
  • installation
  • message
  • module
  • modules

Module chrome

The following standard module chromes are available:

  • none. Output the raw Module content with no wrapping.
  • table. Output the module in a table.
  • horz. Output the module as a table inside an outer table.
  • xhtml. Output the module wrapped in div tags.
  • rounded. Output the module wrapped in nested div tags to support rounded corners.
  • outline. Output the module wrapped with a preview border.

CSS classes

Core CSS Class Used With
active xhtml type menu modules
article_separator articles
author article author
bannerfooter banner module
bannergroup banner module
bannerheader banner module
banneritem banner module
blog blog content
blog_more blog content
blogsection blog content
breadcrumbs breadcrumb module; also see pathway
button miscellaneous
buttonheading miscellaneous
clr miscellaneous
componentheading component
content_email content
content_rating content
content_vote content
contentdescription content
contentheading content
contentpagetitle content
contentpane content
contentpaneopen content
contenttoc content
createdate content
created-date content
current horizontal and vertical type menu modules (legacy)
form-login login module
modlgn_passwd login module
form-login-username login module
form-login-password login module
modlgn_remember login module
hasTip
input forms
inputbox forms
intro
latestnews latest news module
loclink
mainlevel legacy - horizontal, vertical, flat list menu module types; also see sublevel
menu menu modules with xhtml framing
message
metadata
modifydate articles - last modified date/time
moduletable module
mosimage images
mostread most read module
newsfeed news feeds
outline
pagenav page navigation
pagenav_next page navigation
pagenav_prev page navigation
pagenavbar page navigation
pagenavcounter page navigation
pagination page numbering
pathway breadcrumb module; also see breadcrumb
pollstableborder poll module
readon read more link
searchbox search module
search search module
searchintro search module
sections content
sectiontable_footer content
sectiontableentry1 content
sectiontableentry2 content
sectiontablefooter content
sectiontableheader content
small default small font
sublevel legacy - horizontal, vertical, flat list module types; also see mainlevel
title title in xhtml type modules
wrapper wrapper module

Learning resources for HTML and CSS

Using PHP in your template

Operators for use with the countModules function

The following logical, comparison and arithmetic operators are available:

Operator Example Description
 + user1 + user2 Total number of Modules in user1 and user2 positions.
 - user1 - user2 The number of Modules in the user1 position minus the number in the user2 position.
 * user1 * user2 The number of Modules in the user1 position multiplied by the number in the user2 position.
 / user1 / user2 The number of Modules in the user1 position divided by the number in the user2 position.
 == user1 == user2 Returns true if user1 and user2 have the same number of Modules enabled; otherwise returns false.
 != user1 != user2 Returns true if user1 and user2 do not have the same number of Modules enabled; otherwise returns false.
 <> user1 <> user2 Same as !=.
 < user1 < user2 Returns true if user1 has strictly less Modules enabled than user2; otherwise returns false.
 > user1 > user2 Returns true if user2 has strictly more Modules enabled than user1; otherwise returns false.
 <= user1 <= user2 Returns true if user1 has the same or less Modules enabled than user2; otherwise returns false.
 >= user1 >= user2 Returns true if user2 has the same or more Modules enabled than user1; otherwise returns false.
 and user1 and user2 Returns true if user1 and user2 both have at least 1 enabled Module; otherwise returns false.
 or user1 or user2 Returns true if user1 or user2 or both have at least 1 enabled Module; otherwise returns false.
 xor user1 xor user2 Returns true if user1 or user2 but not both have at least 1 enabled Module; otherwise returns false.

Note that if countModules() returns any non-zero number it is equivalent to true; whereas zero is equivalent to false.

More than two module positions can be included in an expression. Evaluation of the expression is performed from left to right subject to operator precedence.

The following table lists the precedence of operators with the highest-precedence operators listed at the top of the table. Operators on the same line have equal precedence, in which case they are evaluated from left to right. The use of brackets to override precedence is not supported.

Operators Operator type
* / Arithmetic operators
+ - Arithmetic operators
< <= > >= Comparison operators
== != Comparison operators
and Logical operator
xor Logical operator
or Logical operator

According to <?php print_r($this); ?> in Joomla! 1.5.9, the object $this within the index.php file of a template looks like:

Object (

[_errors] => Array ( )

[title] => Article Title

[description] => Article Description

[link] =>

[base] => http://www.example.com/page-path-and-filename

[language] => en-gb

[direction] => ltr

[_generator] => Joomla! 1.5 - Open Source Content Management

[_mdate] =>

[_tab] =>

[_lineEnd] =>

[_charset] => utf-8

[_mime] => text/html

[_namespace] =>

[_profile] =>

[_scripts] => Array (

[/test/media/system/js/mootools.js] => text/javascript
[/test/media/system/js/caption.js] => text/javascript

)

[_script] => Array ( )

[_styleSheets] => Array ( )

[_style] => Array ( )

[_metaTags] => Array (

[http-equiv] => Array (
[content-type] => text/html; charset=utf-8
)
[standard] => Array (
[robots] => index, follow
[keywords] => page,keywords
[title] => Article Title
[author] => Article Author
)

)

[_engine] =>

[_type] => html

[_buffer] => Array (

[component] => Array (
[] =>
HTML page content
)

)

[_links] => Array ( )

[_custom] => Array ( )

[template] => template_name

[baseurl] => /

[params] => Array (

[template] => template_name
[file] => this_filename.php
[directory] => /full/system/path/to/this/template

)

[_file] => /full/system/path/to/this_filename.php

)


Examples

<link rel="stylesheet" href="<?=$this->baseurl ?>/templates/<?=$this->template ?>/css/template_css.css" type="text/css"/>

AJAX and JavaScript

Asynchronous JavaScript and XML or AJAX, is a term for a group of interrelated web development techniques used for creating interactive web applications or commonly known as web 2.0. Ajax allows web applications to retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing website page. Data is retrieved using the XMLHttpRequest object or through the use of Remote Scripting in browsers that do not support it.

Ajax Resources:

  1. Packt Publishing Book Free Online Edition
  2. jQuery
  3. MooTools
  4. Prototype
  5. Script.aculo.us
  6. Help I Don’t Know JavaScript Blog


The following diagnostic tools may prove useful when developing templates. Many browsers can act as platforms for diagnostic tools. You can analyze Web pages built with any version of Joomla.

Mozilla Firefox Web Browser

Firebug at work

Internet Explorer Web Browser

Opera Web Browser

Opera has a built-in diagnostic tool called Dragonfly. When viewing the page, right click and choose "Inspect Element" to start Dragonfly.


Safari Web Browser

See also

Personal tools
Namespaces

Variants
Actions
Navigation
Joomla! Sites
Toolbox