Skip to content

Event formatting

24-Jan-11

For time-based placeholders, scroll to the bottom of this page.
The syntax of events format is quite simple. Basically, just write your html code in the usual way. Then you can add a number of placeholders corresponding to the data of the event. Some of them are:

  • #_EVENTNAME displays the name of the event
  • #_ADDRESS displays the address
  • #_TOWN displays the town
  • #_EVENTDETAILS (or #_NOTES) displays the details of the event
  • #_EVENTID displays the unique event ID, in case you want some unique identifier
  • #_EXCERPT shows an excerpt of the event (this is the content of #_NOTES untill you place a <!––more––> marker
  • #_LINKEDNAME displays the event name with a link to the event page
  • #_EVENTPAGEURL simply prints the event URL. You can use this placeholder to build your own customised links
  • #_EVENTPAGEURL{xx} prints the event URL for event ID xx
  • #_EDITEVENTLINK inserts a link to the edit event page, only if a user is logged in
  • #_EDITEVENURL just shows the link to the edit event page (if a user is logged in), not clickable like #_EDITEVENTLINK is
  • #_ADDBOOKINGFORM adds a form which allows the visitors to register for an event. The form is displayed only if RSVP is enabled for the given event. See the placeholder doc concerning ‘Registration form fields’ to change the format of the form.
  • #_REMOVEBOOKINGFORM adds a form which allows the visitors to remove their registration for an event. The form is displayed only if RSVP is enabled for the given event. See the placeholder doc concerning ‘Cancel registration form fields’ to change the format of the form.
  • #_ADDBOOKINGFORM_IF_NOT_REGISTERED adds a form which allows the visitors to register for an event. The form is displayed only if RSVP is enabled for the given event and if the user hasn’t registered yet (only possible to detect if the RSVP is for WP registered users only). See the placeholder doc concerning ‘Registration form fields’ to change the format of the form.
  • #_REMOVEBOOKINGFORM_IF_REGISTERED adds a form which allows the visitors to remove their registration for an event. The form is displayed only if RSVP is enabled for the given event and if the user has registered already (only possible to detect if the RSVP is for WP registered users only). See the placeholder doc concerning ‘Cancel registration form fields’ to change the format of the form.
  • #_CONTACTNAME displays the name of the event contact person
  • #_CONTACTEMAIL displays the e-mail of the event contact person
  • #_CONTACTPHONE displays the phone of the event contact person
  • #_EVENTCATEGORIES displays a comma-separated list of categories an event is in.
    In case you want to show or hide specific categories, you can do so by specifying 2 optional filters to include/exclude categories. To be used like this:
    #_CATEGORIES{1,3}{} ==> this will get all categories for the event, but only show cat 1 or 3
    #_CATEGORIES{}{1,3} ==> this will get all categories for the event, but not show cat 1 or 3
  • #_EVENTCATEGORYIDS returns the different category id’s for an event. Not really usefull, unless you use the shortcode
    No events
    inside a single event format, resulting in a list of events in the same categories as the one being viewed
  • #_LINKEDCATEGORIES creates a link per category for the corresponding event, linking to a list of future events for that category. The same optional filters to include/exclude categories as for #_EVENTCATEGORIES can also be used here.
  • #_DIRECTIONS displays a small form so you can ask for driving directions to an event/location
  • #_ICALLINK displays a link for an ICAL representation of the event
  • #_ICALURL simply prints the ICAL URL. You can use this placeholder to build your own customised links
  • #_PAST_FUTURE_CLASS returning a string that indicates wether this event is in the future or not (eme-future-event or eme-past-event), can be used as extra CSS to the event list
  • #_RESERVEDSPACES (or #_BOOKEDSEATS) gives the number of seats registered in total for an event
  • #_RESERVEDSPACES{xx} (or #_BOOKEDSEATS{xx}) gives the number of seats registered for the xx-th seat category for a multi-seat event
  • #_AVAILABLESPACES (or #_AVAILABLESEATS) gives the number of seats free for an event
  • #_AVAILABLESPACES{xx} (or #_AVAILABLESEATS{xx}) gives the number of seats free for the xx-th seat category for a multi-seat event
  • #_PENDINGSPACES (or #_PENDINGSEATS) gives the number of seats pending for an event
  • #_PENDINGSPACES{xx} (or #_PENDINGSEATS{xx}) gives the number of seats pending for the xx-th seat category for a multi-seat event
  • #_TOTALSPACES (or #_TOTALSEATS) gives the number of seats in total for an event
  • #_TOTALSPACES{xx} (or #_TOTALSEATS{xx}) gives the number of seats in total for the xx-th seat category for a multi-seat event
  • #_USER_RESERVEDSPACES (or #_USER_BOOKEDSEATS) gives the number of seats a users has registered for an event (works only for logged in users of course)
  • #_DAYS_TILL_START returns the number of days until the start of the event
  • #_DAYS_TILL_END returns the number of days until the end of the event
  • #_HOURS_TILL_START returns the number of hours until the start of the event
  • #_HOURS_TILL_END returns the number of hours until the end of the event
  • #_ATTENDEES will return a html-list of names attending the event (formatted via the setting “Attendees list format”)
  • #_LATITUDE and #_LONGITUDE return the langitude and longitude for the location of the event (if present)
  • #_CALENDAR_DAY returns the day being viewed when viewing a specific day on the calendar
  • #_PRICE or #_EVENTPRICE returns the price of an event (if any)
  • #_PRICE{xx} or #_EVENTPRICE{xx} (with xx being a number) returns the xx-th price of a multi-price event (if any). E.g.: #_PRICE{3}
  • #_CURRENCY returns the currency of an event (if any)
  • #_RECURRENCEDESC shows the recurrence info for an event like it does in the admin backend
  • #_CURRENCY returns the currency of an event (if any)
  • #_EVENTIMAGE returns the featured image for the event (if any)
  • #_EVENTIMAGEURL returns just the url to the featured image of the event, if you want to create your own links or smaller image or so
  • #_EVENTIMAGETHUMB shows a thumbnail of the featured image, instead of the whole image. The size can be choosen in the EME settings (panel ‘Other’), by default it is ‘thumbnail’ size
  • #_EVENTIMAGETHUMB{MyCustomSize} shows a thumbnail of the specified custom size of the featured image, instead of the whole image. The size is a custom size either known to wordpress or defined in your functions.php via the function add_image_size()
  • #_EVENTIMAGETHUMBURL returns the url to the thumbnail
  • #_EVENTIMAGETHUMBURL{MyCustomSize} returns the url to the thumbnail of the specified custom size. The size is a custom size either known to wordpress or defined in your functions.php via the function add_image_size()
  • #_BOOKINGS returns a list of bookings for this event. The format can be customized using the ‘Booking list’ option in the EME settings (there the same placeholders as for RSVP mails can be used). In the future this will become a placeholder (not a shortcode) with the event id and a template id as options.
  • #_EVENTATT{xx}{yy} (with xx being an event id and yy being an attribute name) allows to get the non-default value for an attribute from another event. E.g, for eventid 3 and attribute “my_att”: #_EVENTATT{3}{my_att}
  • #_RSVPEND returns the date+time end of the registration period
  • Location placeholders Every location placeholder can be used inside an event as well, see the doc for location placeholders

If you have enabled the Google Map integration, you can use #_MAP to display a map. It is also possible to use #_MAP in the events list page.

Time placeholders

To add temporal information about the events, use PHP syntax format characters with a # before them. For example:

  • #d displays the day of the month, with 2 digits with leading zeros
  • #m displays the short textual representation of a month, three letters (jan through dec)
  • etc

To display the event end time use the PHP syntax format characters with a #@ before them (e.g.: #@h or #@i).
You can also use the following 4 placeholders for convenience:

  • #_STARTDATE , #_STARTTIME , #_ENDDATE and #_ENDTIME which give you the start/end date/time based on your wordpress date/time preferences

If you have problems with the date shortcodes because they get interpreted wrong, like e.g. when you use
#Y#dT#m (“T” just stands for the letter T)
it will try to interpret #dT and not #d followed by “T”. To get around this, use the following notation using curly brackets:
#_{Y}#_{d}T#_{m} or, shorter (just use curly brackets when there is a possibility it gets interpreted wrong, and you can put more php date notations in curly brackets:
#_{Yd}T#m.
The same goes for end dates: #@_{Yd}T#_{m}.
Other example, for easier formatting: #_{d/m/Y}

Some users with older PHP/MySQL versions cannot display time properly through the aforementioned placeholders. They are advised to use the following premade time placeholders:

  • #_24HSTARTTIME displays the start time in a 24 hours format (ex: 16:30)
  • #_24HENDTIME displays the end time in a 24 hours format (ex: 18:30)
  • #_12HSTARTTIME displays the start time in a 12 hours format (ex: 4:30 PM)
  • #_12HENDTIME displays the start time in a 12 hours format (ex: 6:30 PM)

URL escaping

All the placeholders mentioned above can be url-escaped, so you can use them in any url if wanted (eg. see the FAQ section: How to add a “Add to Google Calendar” link to an event). Just prefixing by #URL is enough: #URL_NAME, #URL_EVENTPAGEURL, etc …