How to use template field in the Event Organiser plugin widget

The template field allows you to enter what will appear on the event list widget. It accepts various place holders (you can see the documentation here – the template can be used for the [eo_events] shortcode too).

One of the place-holders is %start{date-format}{time-format}% which outputs the start date/time of an event with the specified date and time format. If it is an all day event, the time format is ignored.

To output just the date part you can use it in the form $start{date-format}% for example

//Output date in the form 1st September 2012
$start{jS M Y}%

Currently, however, there conditional statements are not supported. But I may be adding the option to use a template file instead. This would use a template from your theme folder (if it exists) or else a default template file from the plug-in. This template file will simply contain a while loop (the same as you find in many themes) and would be responsible for outputting the event list.

This would give you a great degree of freedom since you can perform conditional statements such as

if( eo_get_the_start('Y') == date_i18n('Y') ){
    //Event starts this year - don't include year in date format
    echo eo_get_the_start('jS M');

}else{
    //Event starts in a different year - include year in date format
    echo eo_get_the_start('jS M Y');

}