Documentation Menu

1.5 Template Project

The Joomla! Documentation Working Group is running a project to develop detailed reference and tutorial material on Joomla! 1.5 templates.  There is a project page on the documentation wiki where you can see the work in progress and help us by contributing your knowledge.

Who's Online

We have 14 guests online

Help Site License

The Joomla! Help Site content is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution NonCommercial ShareAlike 2.5. Some parts of this website may be subject to other licenses.
Home arrow Manual arrow 4. Mambots arrow Extending Mambots

Extending Mambots PDF Print E-mail
Mambots and Mambot groups can be used for a variety of purposes. For example, suppose you want to include an HTML Templating system like patTemplate ( and load it in your custom components that use it. Here's a rough outline of the steps that you would take to set this up.
  1. Create a directory called "patTemplate" under the /mambots directory.
  2. Unpack the patTemplate distribution file such that patTemplate.php is in the new directory you created. All the patTemplate support files should be in 'another' patTemplate directory. Note that you will also need to include patError.php and patErrorManager.php in this directory. The /mambots/patTemplate directory should now look something like this:
        /patTemplate (many files provided under this directory)
  3. Create an XML setup file for the Mambot listing all the files under the /mambot/patTemplate directory. It might look something like this:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <mosinstall type="mambot" group="patTemplate" version="4.5.1">
      <version>3.0 Beta 1</version>
      <author>Stephan Schmidt</author>
      <license> GNU/LGPL</license>
      <description>Powerful templating engine</description>
        <filename mambot="patTemplate">patTemplate.php</filename>
    Notice that the file patTemplate.php is given the "mambot" attribute to signify that this is the file to be loaded by the Mambot handler.
  4. Zip up the contents of the /joomla/patTemplate directory and install the Mambot. You should see it listed in the Mambot Manager.
  5. To use this in your code, you would use something similar to the following:
    global $_MAMBOTS;
    if (!$_MAMBOTS->loadBotGroup( 'patTemplate' )) {
      die( 'This component requires the patTemplate Plugin' );
    $tmpl =& new patTemplate( 'html' );
    There are obviously many other applications for this technique.

Last Updated ( Thursday, 15 September 2005 )
< Prev   Next >