Joomla 1.5: Template conditional code

Template conditional code.

There two types of Joomla conditions
1. Module count conditions
2. Parameter Conditions

Joomla module count conditions are base on whether a module name position is active.
Modules are tied into the menu system in a few ways but I’m going to mention only the basics
for now. So you can understand how module count conditions work with the menu system.

Modules can be assigned to show and hide based on the location of the user or access level.
To view module assignment control go to the Module Manager administrator.
Click on any module and scroll down to see the Menu Assignment Controls.

The default Joomla data install uses three menus Mainmenu, Keyconcept, ExamplePages.
At this point the Menu Assignment Control module will show on every page on your site.

If you were to select one or more menu links the module would only show on page links selected.
Now the module count condition looks to see if a module is active in a section of the site and shows or hides anything
between the condition tags based on whether the module is active or not.

The code checks to see if the module left is active if so any code between the PHP IF tags will show.

This is very useful when you need to show or hide layouts, content, other items etc.
You may add more complex conditions to the module by adding “AND OR” other operators to the IF expression.
See J conditions tools

You can also add any PHP conditions to the template index.php file.

Parameter Conditions
Param conditions are not as power full as Module count conditions.
But still are very useful if used in the right way if the condition is met it will show the code between the PHP tags.
see the next page for more on params and See J conditions tools for more on conditions.