From version 1.5.2 onwards of JEvents its possible to apply multiple template overrides for the latest events module.  This means that you can have one module that displays "Today's Events" and another displaying "This Weeks Events" and have these formatted in completely different ways.

This article describes this process based on a specific example - where the latest events appear withing a vertical auto-scrolling element (known as a marquee in HTML).

The first thing to do is create a new latest jevents module and set the parameters as in the following screenshot.

LatestScrolling

The important points to note are

  • We have named the "Override Layout" as "latestscrolling".  We will create a specific layout to match this name which will then be used by this module.
  • We have said to "Use Settings Below"

You now need to create a special template override file.  I am using the Ruthin layout and my template is ja_purity so the file I create is called:

templates/ja_purity/html/mod_jevents_latest/ruthin/latestscrolling.php

If you are using a different template and/or layout then change this file path to match your settings.

The code of this file is very simple:

/**
* copyright (C) 2010 GWE Systems Ltd - All rights reserved
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();

// make sure the parent class is included
include_once(JPATH_BASE.DS.'modules/mod_jevents_latest/tmpl/ruthin/latest.php');

/**
* HTML View class for the module  frontend
*
* @static
*/
class OverrideRuthinModLatestViewLatestscrolling extends RuthinModLatestView
{
function displayLatestEvents(){

$content = "";
$content .= parent::displayLatestEvents();
$content .="
\n";

return $content;
}

}

You can download the file itself here.

Note that if you use a layout other than Ruthin you need to change the references to Ruthin to your layout e.g. Extplus (match the upper/lower case text).