The Add to Calendar block

The Add to Calendar block puts a row of links under your event so a visitor can copy it into their own calendar in one click. Nothing is stored on your site: each link simply prefills a new entry in the visitor’s calendar service.

Adding the block

Look for Add to Calendar in the HappenBoard category of the inserter. Like the other event blocks it reads the event it sits on, so place it on a single event page or in a single event template. Outside an event, the editor shows a placeholder instead.

The block needs both a start and an end date and time on the event. If either is missing it renders nothing, because a calendar entry with no end is not something the three services accept. Dates, times and all-day events explains where those two fields live.

Choosing the destinations

The Targets panel in the block settings holds one toggle per destination:

  • Google Calendar, on by default. The link is labelled Google.
  • Outlook, on by default. The link is labelled Outlook.
  • Yahoo Calendar, off by default. The link is labelled Yahoo.

Turn on only what your audience actually uses. Every enabled toggle adds one more link to the row, and three buttons where one would do is just noise. If you switch all of them off, the block disappears from the page.

The links open in a new tab, so the visitor keeps your event page open behind them.

HappenBoard builds the link from the event itself. Four pieces of information travel with it:

  • Title: the event title, exactly as published.
  • Dates: the start and the end, converted to UTC so the visitor’s calendar places them correctly whatever timezone they are in.
  • Location: the venue name, followed by the venue address when there is one.
  • Description: the event excerpt. If the excerpt is empty, the first fifty words of the event content are used instead. The link to your event page is added at the end either way.

That last point is worth a moment. Because the description always ends with your event URL, anyone who accepts the calendar entry keeps a way back to your site, which matters when details change later. Filling in a short excerpt on the event gives you control over what that description says. Venue details come from the venue attached to the event, so a well filled venue record pays off here too: see Venues: creating and geocoding.

Styling the block

The block accepts text, background and link colours, padding, margin, the gap between the links, plus font size and line height. The links are ordinary anchors, so a theme that styles buttons will usually style these too.

One-off copy or a live subscription

This block makes a one-time copy. If the event moves afterwards, the visitor’s copy does not follow: they keep whatever the calendar recorded at the moment they clicked.

When you want people to stay in sync with your whole calendar instead, point them at the iCal feed. A feed is subscribed to once and refreshes on its own, which suits a season programme or a recurring meetup far better than a stack of individual copies.

What’s next