This article describes the custom format strings in the latest events module - and makes reference to incorporating elements from club addons e.g. custom fields, images
If your format string is being ignored MAKE SURE you have 'Use settings below' checked in your module parameters.
The custom formatting strings are based around substituting field codes with their values from an event - the available fields are:
All the date fields take formatting options e.g. ${endDate(%I:%M%p)} o r${startDate(D, M jS, Y, @g:ia)}. There are 2 formatting systems you can use based on the php "date" and "strftime" functions - see http://php.net/manual/en/function.date.php and http://php.net/manual/en/function.strftime.php . You should not mix and match there within a specific field
Sometimes you might want to hide a field or change it's output if there is no value. The Latest Events Module uses the same system as: the custom layouts for handling missing values. So for example you could have:
${CONTACT# The contact for this event is: %s# There is no contact for this event at present#}
Which if there is a contact called 'Tony Partridge' for example, it would output:
The contact for this event is: Tony Partridge
And if there is no contact it would show:
There is no contact for this event at present
There is limited support for conditional output in the format string. The module supports 3 different conditional flags:
You would use [a: xxxxxxxx] to output xxxxxxxx when the condition is true or [!a: yyyy] to output yyyy when the condition is not true.
For example if we had this format string:
[codep]${startDate(%A %B %e)}[!a:, ${startDate(%l:%M %p)} - ${endDate(%l:%M %p)}][/codep]This would only output the start and end time for an event that is not an all day event
You can 'combine' these conditions e.g.
[codep]${startDate(%A %B %e)}[!a:, ${startDate(%l:%M %p)} - ${endDate(%l:%M %p)}][a: - All Day][/codep]
This would output something like this for an event with a start and end time
Sunday September 12, 10:00 AM - 6:00 PM
and
Sunday September 12 - All Day
for an event with no end time.
You can also convert this to 24 hour by using:
[codep]${startDate(%A %B %e)}[!a:, ${startDate(%H:%M)} - ${endDate(%H:%M)}][a: - All Day][/codep]
Which would show:
Sunday September 12, 10:00 - 18:00
and
Sunday September 12 - All Day
You cannot embed these conditions inside each other.
The following fields are supported ${loc_title}, ${loc_id}, ${loc.street}, ${loc_desc}, ${loc_postcode}, ${loc_city}, ${loc_country}, ${loc_state}, ${loc_phone}, ${loc_image}, $loc_url}
You must enable the display of images in list views in the plugin parameters if you want to use thumbnail images in your latest events module.
The following fields are available: The images as full html image tags = ${imageurl1}, ${thumbimg1} and the URLs of the images are ${imageimg1}, ${imagethumb1}. Note if you are wanting to show the default set image if no image has been set, use the tags in this format: ${JEV_LIST_THUMBNAIL_1}
As of Standard Image and Files Version 3.5 we had added a new smart method to get images.
You can now use: ${JEV_SIZEDIMAGE_1;50x50} which would automatically resize the image at 50x50 if it doesn't exist already. notice the _1 so you would change this to say _2 for image 2 and so on.
You must enable the display of custom fields in list views in the plugin parameters and use the special new version of the module in the custom fields download area.
For a field with a name of field1 you use this code ${field1}
If you wish to get the value you set within the field you can use: ${field1_raw}
You must enable the display of tags in list views in the plugin parameters.
Use the code ${jevtagstext}, ${jevtags} or ${jevtagsraw} - the first of these includes a label as well as the list of tags.
Finally if the fields you are interested in are not listed above then you can use the 'codes' from the JEvents layout editor (for list views) in the custom format string. For example
GWE Systems Ltd, the company behind JEvents, is excited to announce the preview release of EasyLayouts - the tool that makes it easy to create layouts for your Joomla content and custom fields.
See our blog post for an exciting special offer to our Gold Members