This article sets out in more detail how to create a template override for the event detail page.  It assumes that you have read and are familiar with the general introduction to template overrides.

We will cover the available methods and variables including those that come from the JEvents Locations and People addons.

There are 2 files that control the layout:

  • detail.php
  • detail_body.php

If using Joomla 1.6, 1.7 or 2.5 we have a new file called:

  • detail_body16.php

which is used instead of detail_body.php.

detail.php

This file controls the header and footer (which you should need to change) as well as the inclusion of the iconic navigation tool bar and the admin panel (i.e. the add events, show unpublished events block you see when you are logged in).

If you don't want the toolbar or admin panel then remove these lines from your template override file.

detail_body.php

This is the file that does the main part of the layout work.

The main part of the layout occurs from link 36 onwards after the statement

if (isset($row)) {

Taking the rows of the table (as in the standard layout) in turn:

  1. The event title ( obtained via $row->title() ) and the event edit icon.
  2. The hidden event editing popup dialog that appears when you click the edit icon.
  3. The repeat summary, links to the previous and next links, a link to the creator (either email or contact form) and the hits counter
  4. The event description ( obtained via $row->content() )
  5. The row location and contact info
    1. If the managed locations addon/plugin are installed then a call to $row->location() returns a brief summary of the event location with a clickable google map
    2. The contact info field has URLs converted into clickable links automatically
  6. Extra information (obtained via $row->extra_info() )
  7. Custom Fields - if you have installed custom addons like the managed people or events report/agenda plugins then this fetches the relevant data and displays it sequentially.
  8. Finally there is a call the onAfterDisplayContent which can be used to add additional information to the event layout e.g. from event registration addons.

Customising detail_body.php

Available fields and methods:

  • $row->startDate() - YYY-MM-DD formatted start date for the repetition
  • $row->endDate() - YYY-MM-DD formatted end date for the repetition
  • $row->title() - Title of the event repetition
  • $row->content() - Description of the event repetition
  • $row->useCatColor() - Does the event use the category colour?
  • $row->catid() - Category id
  • $row->catname() - Category name
  • $row->getCategoryDescription() - Category description
  • $row->created_by() - User id of the author of the event
  • $row->hits() - hits count
  • $row->published() - Is the event published or not
  • $row->alldayevent() - Is the event repetition an all day event
  • $row->noendtime() - does the event repetition have an end time
  • $row->multiday() - is the event repetition a multi day event
  • $row->access() - joomla access level for the event
  • $row->location() - the event location - either a text field or an extended field based on the managed locations addon
  • $row->contact_info() - the event repetition contact info field
  • $row->contactLink() - a link to the event contact
  • $row->extra_info() - the event repetition extra info field
  • $row->published() - Is the event published or not
  • $row->yup() - Year of start of event repetition
  • $row->mup() - Month of start of event repetition
  • $row->dup() - Day of start of event repetition
  • $row->hup() - Hour of start of event repetition
  • $row->minup() - Minute of start of event repetition
  • $row->sup() - Second of start of event repetition
  • $row->ydn() - Year of end of event repetition
  • $row->mdn() - Month of end of event repetition
  • $row->ddn() - Day of end of event repetition
  • $row->hdn() - Hour of end of event repetition
  • $row->mindn() - Minute of end of event repetition
  • $row->sdn() - Second of end of event repetition
  • $row->isrepeat() - Is the event a repeating event
  • $row->repeatSummary() - a basic summary of the event's repetition pattern
  • $row->prevRepeat() - a link to the previous repeat (or blank if none)
  • $row->nextRepeat() - a link to the next repeat (or blank if none)

Extra Information From Managed Locations

This is accessible via $row->_jevlocation and is a stdClass with the following variables access, alias, catid, city, country, created, created_by, description, geolat, geolon, geozoom, global, loc_id, modified_by, postcode, published, street, title.

So to get the location's postcode you would use $row->_jevlocation->postcode.

Extra Information From Managed People

This is accessible as an array of stdClass objects.  These objects have the following variables access, alias, catid0, catid1, catid2, catid3, catid4, city, country, created, created_by, description, geolat, geolon, geozoom, global, images, modified_by, pers_id, postcode, published, state, street, title, type_id, typename, www

So to get the www url of the person you may use (for example) $row->_jevpeople[0]->www