The Yireo Template Helper allows you to add simple PHP-logic to your own Joomla! template, without the need for a more complex templating framework. If you are building your own template, the class might included many useful calls.
You might have heard about IE8 issues that can be solved by putting the browser into IE7 Compatibility Mode. While this can be done by the visitor itself, it of course makes much more sense if your website is able to tell this to the website itself.
With Joomla! templates, there are various ways to deal with different browser-types. This might be necessary to add specific CSS-code for specific browsers, so within the world of webdesign there are already many tricks: A good designer knows about the VisualBasic-tricks for IE, but few know that there is also a Joomla!-class providing excellent browser-detection.
Using PHP-code within the Joomla! template gives the template more dynamic, more intelligence. For instance, you can use simple PHP-code to determine whether the left-column contains modules, and if not, remove the left-column. Let's take a look at all the opportunities here.
Building a splitmenu with Joomla! modules is good for many cases, but it has a few downsides: For instance, if the submenu is empty, the menu-module will still display. Also, the title of the submenu-module is static, while you might want to display the title of the parent menu-item instead. With our Yireo Template Helper these things are made simple.
With the PHP-class Yth (Yireo Template Helper) you can optimize CSS-files within your own Joomla! template, with as little PHP-code as possible. For a good website, a fast template is vital. The Yireo Template Helper helps you with this.
When optimizing Joomla! for performance, one trick is to limit the number of HTTP requests. Every time a new CSS-stylesheet is added to the Joomla! page, a new HTTP request needs to be made by the browser to fetch that file. This costs extra bandwidth and extra time.
Joomla! 1.5 introduced the possibility of overriding the default offline-template by copying the file offline.php to your own Joomla! template-directory. However, not so many people know you can also add module-positions to your custom offline-page.
Joomla! 1.5 ships with splitmenu functionality, which allows you to display a multi-level menu-hierarchy with different menu-modules. This allows for advanced menu-structures based on just a single menu tree. Splitmenu is based on the Menu Module-parameters startlevel and endlevel. There are some shortcomings though in this functionality. In this tutorial we will overcome these problems by writing our own better version of splitmenu.
Joomla! has introduced template overrides (or output overrides) to alter the HTML-output of modules and components without making core hacks. For most extensions making template overrides is pretty straightforward. However, overriding the menu-module isn't. In this tutorial we will alter the module mod_mainmenu to add a CSS-class first to the first menu-item and a CSS-class last to the last menu-item.