Inline Templates

Inline templates provide a simple way to format events that you have embedded in a page with the [event_embed] shortcode. Here’s an example:

[event_embed from="+1 week" to="+2 weeks" category="dances"]
    {title:linked} on {start_date} at {start_time}
[/event_embed]

So, within our shortcode, we have various curly braced {placeholders} which are magically transformed into whatever they are meant to represent. Placeholders are, in a manner of speaking, somewhat like shortcodes – but are far simpler and quite deliberately are not as flexible.

Our above example would be rendered into something like this:

Barn Dance on 15 December 2016 at 2:00pm
Hoedown and Cider Chugging on 17 December 2016 at 8:00pm

So why use inline templates?

  • They’re easy to use – you don’t have to create a PHP template to get a custom layout
  • You can embed single pieces of event data (a date, time or venue for instance) within a sentence, avoiding the need to manually update a reference to an event time from a blog post, etc
  • Creating new placeholders if you need them is possible and quite straightforward

What placeholders are available?

As of version 3.1, the following placeholders are available:

{link}               - a URL for the event
{url}                - alias of {link}
{title}              - the event title
{title:linked}       - the event title, but rendered as a link to the event page
{name}               - alias of {title}
{content}            - the event content/description
{content:unfiltered} - the event content/description but without any filters applied
{description}        - alias of {content}
{excerpt}            - the event excerpt
{thumbnail}          - the event thumbnail or featured image
{author}             - author's display name
{start_date}         - date the event starts   --+
{start_time}         - time the event starts     |__ all of these respect the date and time
{end_date}           - date the event ends       |   formats configured for WP globally
{end_time}           - time the event ends     --+
{venue}              - name of the venue for the event
{venue:name}         - verbose alternative for {venue}
{venue:link}         - name of the venue, rendered as a link to the venue page
{venue:url}          - the venue page URL
{venue:map}          - embeds a map showing the venue
{venue:details}      - the venue details (name and address)
{organizer}          - name of the event organizer
{organizer:link}     - name of the event organizer, rendered as a link to the organizer page
{organizer:url}      - the organizer page URL
{cost}               - event cost
{cost:formatted}     - event cost with currency formatting