Joomla!
Joomla! 1.5 Templates - Conditional Statements
Submitted by admin on 16 June 2008 - 6:00pm tags:| Conditionals | What They Do |
|---|---|
|
<?php if($this->countModules('condition')) { ?> do something <?php } else { ?> do something else <?php } ?> |
Joomla! 1.5 Templates - Include Statements
Submitted by admin on 16 June 2008 - 5:58pm tags:| jdoc:includes | What They Do |
|---|---|
| <jdoc:include type="head" /> | Includes default header section xhtml in template's index.php file |
| <jdoc:include type="modules" name="nnn" style="sss" /> | Includes all active modules assigned to a position in template's index.php file |
| <jdoc:include type="module" name="nnn" style="sss" /> | Includes one particular active module assigned to a position in template's index.php file |
| &<jdoc:include type="component" /> | Includes component position in template's index.php file |
| &<jdoc:include type="message" /> | Includes system and error messages in template's index.php file |
| Examples of Include Usage |
|---|
|
<jdoc:include type="head" /> – inserts the following xhtml statements within <head></head> in the template's index.php file:
<base href="http://domain-name.domain-sufffix/" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="robots" content="index, follow" /> <meta name="keywords" content="joomla, Joomla" /> <meta name="description" content="Joomla! - the dynamic portal engine and content management system" /> <meta name="generator" content="Joomla! 1.5 - Open Source Content Management" /> <title>>Welcome to the Frontpage</title> <script type="text/javascript" rel="lightbox" src="/media/system/js/mootools.js"></script> <script type="text/javascript" rel="lightbox" src="/media/system/js/caption.js"></script> |
|
<jdoc:include type="modules" name="left" style="xhtml"/> – defines where the "left" module position will be placed in template's index.php file layout and use of the "xhtml" module encapsulation style for all modules assigned to the "left" position:
<div id="leftbox"> <!-- left module display --> <jdoc:include type="modules" name="left" style="xhtml" /> </div> <!-- end leftbox display --> More details about the <jdoc:include type="module" name="nnn" style="sss" />: The name="nnn" is the name of the position the module lives in when it is active. Joomla! has a number of pre-defined module positions and you also have the ability to add your own ( see the TemplateDetails.xml discussion). The style="sss" tells Joomla! what kind of xHTML constructs to generate. The choices are:
|
|
<jdoc:include type="component" /> – defines where the "component" position will appear in template's index.php file layout:
<div id="middlebox"> <!-- component display --> <jdoc:include type="component" /> </div> <!-- end component display --> |
Joomla! 1.5 Templates - TemplateDetails.xml
Submitted by admin on 16 June 2008 - 5:54pm tags:templateDetails.xml
What is This?
In simple terms, the templateDetails.xml file tells the template installer what to install, where to install it, and other advanced stuff such as what options will be available for managing the template once it is installed . The examples shown below illustrate the what and where. The more advanced control functions are beyond the scope of this discussion.
What Has Changed?
When modifying a Joomla!. 1.0.x template to function for use with Joomla! 1.5, the templateDetails.xml file requires some changes. I guess the best way to describe the basic changes is by example. In the examples below, red and green text highlight the major differences. I hope I haven't missed any! But if I have, feel free to let me know.
| Simple Joomla! 1.0.x Install File |
<?xml version="1.0" encoding="iso-8859-1" ?> <mosinstall type="template"> <name>hrpr_gray_hz</name> <creationDate>2005-10-16</creationDate> <author>John Doe</author> <copyright>John Doe</copyright> <authorEmail>jmdoe@some-domain.com</authorEmail> <authorUrl>www.some-domain.com</authorUrl> <version>1.0.x</version> <description>Joomla 1.0.x Sample templateDetails file</description> <files> <filename>index.php</filename> <filename>template_thumbnail.png</filename> <filename>scripts/digiclock.js</filename> <filename>scripts/hide.js</filename> </files> <images> <filename>images/comp010.jpg</filename> <filename>images/arrow3up.gif</filename> <filename>images/arrow3down.gif</filename> <filename>images/search.png</filename> <filename>images/thepoint2.png</filename> <filename>images/hrbanner1.png</filename> <filename>images/arrow.png</filename> <filename>images/arrowgray.png</filename> <filename>images/leftspacer.png</filename> <filename>images/homepage.png</filename> <filename>images/arrowright.png</filename> </images> <css> <filename>css/template_css.css</filename> </css> </mosinstall> |
| Simple Joomla! 1.5 Install File |
<?xml version="1.0" encoding="utf-8" ?> <install version="1.5" type="template"> <name>hrpr_gray_var</name> <author>Jane Doe</author> <copyright>Jane Doe</copyright> <authorEmail>jfdoe@some-domain.com</authorEmail> <authorUrl>www.some-domain.com</authorUrl> <license>GNU/GPL</license> <version>1.5</version> <description>Joomla 1.5! sample templateDetails file</description> <files> <filename>index.php</filename> <filename>templateDetails.xml</filename> <filename>template_thumbnail.png</filename> <filename>scripts/index.html</filename> <filename>scripts/digiclock.js</filename> <filename>images/index.html</filename> <filename>images/comp010.jpg</filename> <filename>images/arrow3up.gif</filename> <filename>images/arrow3down.gif</filename> <filename>images/search.png</filename> <filename>images/thepoint2.png</filename> <filename>images/hrbanner1.png</filename> <filename>images/arrow.png</filename> <filename>images/arrowgray.png</filename> <filename>images/leftspacer.png</filename> <filename>images/homepage.png</filename> <filename>images/arrowright.png</filename> <filename>images/smdsmall.png</filename> <filename>css/index.html</filename> <filename>css/template_css.css</filename> </files> <positons> <position>top</position> <position>left</position> <position>right</position> <position>bottom</position> <position>advert1</position> <position>syndicate</position> <position>footer</position> <position>user1</position> <position>user2</position> <position>user3</position> <position>user4</position> <position>user5</position> <position>user6</position> <position>user7</position> <position>user8</position> <position>user9</position> <position>user10</position> </positions> </install> |
Note the addition of the <positions> section and <position> directives. This is a major change from Joomla! 1.0.,x to Joomla 1.5. The temlplate's module positions are now defined in the templateDetails.xml file rather than in the Joomla! administrator interface. Also, the administrator interface no longer supports the "Preview with Module Positions" function included in Joomla! 1.0.x. To see a preview with the module positions included, use the following url syntax:
- http://your-domain-name.your-domain-suffix/index.php?tp=1
Joomla! 1.5 Templates - Introduction
Submitted by admin on 16 June 2008 - 5:50pm tags:Overview of Joomla! Templates
The index.php file in a Joomla! template can be viewed as the "engine" that determines the content and layout of each page in conjunction with the template_css.css file in the template's /css subdirectory and image files contained in the template's /images subdirectory,
What Has Changed?
Just about everything! However, if you don't want to read any further, just turn on "Legacy Mode" in your Joomla! 1.5 confguration and your existing Joomla! 1.0.x templates will work with Joomla 1.5.
Template Functions and Constructs
Joomla! 1.5 templating is accomplished via a combination of xHTML, PHP and <jdoc .. /> statements. Ths dicussion concentrates on the PHP and <jdoc .. /> stuff. The xHTML stuff is left as an exercise for the reader, as is any in-depth discussion of PHP.
In general the template statements cause some configuration value to be inserted, xHTML statements to be generated and then inserted, some conditional action to take place, or a combination thereof. Sophisticated templates often contain a variety of PHP statements and Joomla! function calls, however, the directives listed below comprise the basic set found in the vast majority of templates.
Joomla! 1.5 Template Primer
Submitted by admin on 16 June 2008 - 5:43pm tags:What is This?
Caveat emptor: This information has not been updated since the Joomla! 1.5.3 release in April 2008.
This is some stuff I learned while attempting to upgrade my existing Joomla! 1.0.x templates to work with Joomla! CMS 1.5. There's nothing much original here. The information in the underlying pages was gathered from Developer Blogs, Documentation and various Forum Posts at the official Joomla! Project web site.
Very Brief Overview
Joomla! is an Open Source (GPLv2) CMS that uses modules, components, and plugins to organize, manipulate and present content. A complete discussion of these constructs is beyond the scope of this discussion. If you are new to all this, you can find more information about this stuff at Joomla.org:
If you are still interested in this stuff after reading the above, read the underlying pages and learn arcane techno-factoids about stuff like templateDetails.xml, index.php, template_css.css.and last, but certainly not least, the core css classes.
Drupal 6 RC2
Submitted by PropHead on 11 January 2008 - 12:20pm tags:Drupal 6 RC2 was released yesterday. And, I must also say that the more familiar I have become with Drupal 6, my previous opinion that building Drupal themes is not as straightforward as building Joomla! templates has mellowed quite a bit.
Why the change of heart, you ask? Read on to find out...
Drupal 6 RC1
Submitted by PropHead on 22 December 2007 - 9:45pm tags:Drupal 6 RC1 was released on 21 December. The last Beta (4) was fairly stable so maybe it won't be too long until a Drupal 6 stable release hits the streets. I think there's a good chance that the Drupal 6 and Joomla! 1.5 stable releases might occur within weeks (or maybe days) of each other.
I've been fooling with both Joomla! 1.5 and Drupal 6 for quite a while now. Both are significant improvements over their predecessors. For example, Joomla! 1.5 has made significant improvements in their SEF implementation and intoduced template overrides; Drupal has made significant improvements in caching and has also simplified theming. Buildng Drupal themes is still not as straight forward as templating in Joomla!, but this lastest release takes a big step in the right direction.
Congrats to both the Drupal and Joomla! core teams for making my two favorite CMS's even better!
1,000,000 Posts
Submitted by PropHead on 20 September 2007 - 8:32am tags:The Joomla! Forum hit a milestone today. It now has over 1,000,000 posts. Not bad for a project that has only been around since the Fall of 2005.
If you are not familiar with Joomla!, you might want to take the time to check it out. It is a really good CMS, especially the new 1.5 version, which is now in the release candidate state.

