The calendar, the event page, the reservation form and the e-mails of WXP Local Events are Twig templates. This guide lists the templates, the values they receive and how to make your own. For an introduction to Twig and the lookup order, see General Developer Information → Twig.
Templates #
| File | Name | What it is |
|---|---|---|
default.html.twig |
Default | The calendar: a month grid and a list of events. Used by the shortcode [wxp_events], the block and the widget through the template parameter. |
single.html.twig |
Event page | What the plugin adds to the page of an event: the details above the text, the next dates and the reservation form below it. |
reservation-form.html.twig |
Reservation form | The reservation form of one event. Also used by [wxp_event_reservation_form]. |
mail-simple.html.twig |
Simple | A plain e-mail. |
mail-modern.html.twig |
Modern Business | An e-mail with a coloured header and a button. |
_base.html.twig, _month.html.twig, _list.html.twig, _popup.html.twig |
Partials | The wrapper of the calendar, the month grid, the list grouped by month and the popup with the basics of an event. |
A template name that does not exist falls back to default.
Your own template #
- Copy the file to
wxp-local-events/in your child theme. A file with the same name replaces the original; a file with a new name can be chosen with thetemplateparameter. - Copy
default.html.twigfor a calendar. It extends_base.html.twigand fills the blockbody. When a visitor changes the month or the view, only this block is rendered again. - Keep the
data-wxp-le-*attributes. The script finds the buttons, the popup and the form with them. - The layouts of the event page (standard, picture, card and compact) are in
single.html.twig: it receives the chosen layout inlayout, and the layouts differ in the picture and in the CSS. The title, header and footer stay those of your theme.
Values in the templates #
| Template | Name | Contents |
|---|---|---|
| Calendar | view |
month or list. |
| Calendar | calendar |
label, prev, next, weekdays (each with short and long) and weeks (days with in_month, is_today, is_past and cards). |
| Calendar | groups |
The list of coming events by month: each group has a label and cards. |
| Calendar and page | card |
One date of an event: title, url, weekday, day, state, full, color and more. |
| Event page | content, form, layout, card |
The text of the event (HTML), the reservation form (HTML), the chosen layout and the current date. |
| Reservation form | form |
event, reservable, dates and notice. |
subject, lang, intro, note, venue |
The subject, the language code, the opening text, an extra note and the name of the venue. | |
rows, button, cancel, cancel_url, color, site_url |
The details (each with label and value), the button, the cancel link, the accent colour and the address of the website. |
|
| All | labels, box_id |
Translated texts and a unique id on the page. |
Add your own values with the filter wxp_local_events_template_context (see Filter- and action hooks).