Add to Calendar for Bricks
A calendar button for your events. Visitors pick Google, Outlook, Microsoft 365, Yahoo, or download an .ics file for Apple Calendar and anything else that reads one. It works for a single event, a hand-written list, one button for each item in a query loop, or one button that adds every item the loop shows.
One event
- Add Add to Calendar to the page (General).
- Fill in Starts, and optionally Ends, Title, Location and Description.
Dates are written in the site time zone, for example 2026-11-14 09:00. Each calendar converts them for the visitor, so someone in another country sees the right hour. Day-first dates like 14/11/2026, 20261114 and plain words such as 14 November 2026 are understood too.
- If Ends is empty the event lasts 60 minutes, or whatever you set in Length when there is no end.
- A start with no time becomes an all-day event (switch that off if you prefer, or tick All-day event yourself). For an all-day event, Ends is the last day, so a trip from the 6th to the 12th is written 6 to 12.
- If Title is empty the page or post title is used. The page address is added to the description unless you turn that off.
The event being viewed (single event pages)
On a template for a single event, add one Add to Calendar element and fill the fields with dynamic data, so every event page offers its own event. For example, with ACF date fields:
- Title:
Add to Calendar for Bricks - Starts:
{acf_start_date}and Ends:{acf_end_date} - Location: a field or taxonomy term, for example
{post_terms_event_location:plain} - Description: a short subtitle field
Place it under the booking details or price. The outline button style and Hide the colour dots suit a quiet spot in a hero or sidebar.
One button for each item in a query loop
Put the element inside a Block or Container that has Use Query Loop switched on. Fill the fields with dynamic data, such as the title, a date field for the start and another for the end, and a text field for the location. Each result gets its own button with its own details.
One button that adds everything the loop shows (new in 0.3)
For an archive of events you often want a single button beneath the grid that adds all of them. It takes two elements:
- Collect: inside the loop item, add an Add to Calendar element and set Events to Collect (inside a query loop). Fill in the title, start, end, location and description with dynamic data, exactly as for one event. It shows nothing on the page; it only leaves a hidden record of that item.
- Add all: after the loop, add another Add to Calendar element and set Events to Add all (after the loop).
When the button is clicked, the browser builds one .ics file from the records that are on screen at that moment. That means it follows filters, search boxes and load-more buttons that change the loop, and it never includes an item the visitor cannot see. The .ics file holds one event per item.
- Add all button text: use
{count}for the number of events, for example Add all {count} events to your calendar. The count updates when the loop changes, and the button hides itself when no event is showing. - Only count events inside: an optional CSS selector, such as
.event-grid, to limit the button to one loop when a page has several. Leave it empty to use the whole page. - File name: the name of the downloaded file, without the extension.
- All the usual button settings apply: style, alignment, colour, corner radius, padding and typography.
Without JavaScript the button falls back to an ordinary link to an .ics file that the server builds from the same events.
A list of events
Set Events to A list of events and add them in the repeater. Each shows its title and date with its own button, and an Add all to calendar (.ics) button downloads every event in a single file. Clear that button text to hide it.
Choosing how it looks
- Calendars to offer: any mix of the five. Leave it empty for all.
- Show as: one button that opens a menu, or a button for each calendar.
- Button text, an optional calendar icon, and a colour dot beside each calendar. Tick Hide the colour dots to remove them (new in 0.3.2).
- Solid, outline or link button style, alignment (start, centre, end, full width), colours, corner radius, padding, menu colours and typography.
- The menu, its items and the list rows follow Corner radius, so a square design stays square all the way through (0.3.1).
- Reminder in the .ics file: ask the calendar to alert the visitor this many minutes before. Google, Outlook and Yahoo set their own reminders.
Keyboard and screen readers
The menu button reports whether it is open. Opening it moves focus to the first calendar, the arrow keys move between calendars, Escape closes it and returns focus to the button, and tabbing away closes it. Every calendar is a real link. The menu flips upwards or to the right edge if there is no room.
How the .ics links work
For a single event the .ics link is generated on the server and signed, so it opens straight in Apple Calendar on an iPhone or Mac and works without JavaScript. Only the events your page built can be downloaded, and changing the link by hand gives an error. The Add all button builds its file in the browser; its no-JavaScript fallback is a short stored link, because a signed link for a long list would be too long for many servers. Stored links last 30 days.
Good to know
- Recurring events are not supported; add each date as its own event.
- Descriptions are plain text and are cut to 600 characters so the links stay short enough for every calendar.
- Titles, locations and descriptions are turned into plain text, so an ampersand stored as
&in your content appears as a normal ampersand in the calendar (0.3.3). - An all-day event with an end date is exported correctly even though .ics files treat the end day as exclusive; the extra day is added for you.
- If the start date cannot be read, nothing is shown on the live page. In the builder you see a reminder instead.
Changes
- 0.3.3: HTML entities such as
&are turned back into characters in titles, locations and descriptions. - 0.3.2: new Hide the colour dots switch.
- 0.3.1: the menu, its items and the list rows follow the corner radius setting.
- 0.3.0: new Collect and Add all sources for query loops, a {count} placeholder for the Add all text, and a stored-link fallback for long lists.
- 0.1.2: one event, a hand-written list, Google, Outlook, Microsoft 365, Yahoo and .ics.