Add option to customise event HTML

Created on 28 February 2022, over 3 years ago
Updated 5 June 2025, 2 days ago

Problem/Motivation

Currently there is no way (except via custom JS) to customise the HTML for events added to the calendar - e.g. to add certain classes, a span with some extra info etc. Fullcalendar v4 has an 'eventRender' callback option to allow customising the HTML by returning an element - there might be a common need to make use of this.

Proposed resolution

Attached patch adds a 'Templates' / 'Event' section to Fullcalendar view style settings, with checkboxes to use a template, replace the whole event element or just the inner HTML, and a textarea to enter the template for the HTML, using JS template literal format (with a variable 'info' available as per https://fullcalendar.io/docs/v4/eventRender). NB the template literal is not really such but passed as a string (xss-filtered), and so uses a custom function to interpolate 'info' object properties - no other functionality is evaluated.

Remaining tasks

Would templates for other components be handy?

✨ Feature request
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada bgilhome Victoria

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States dcam

    I've volunteered to help clean up the FullCalendar issue queue. As part of that effort I'm closing issues open for unsupported versions of the module.

    If there's still interest in adding this functionality to the module, then feel free to re-open it and update the version number.

Production build 0.71.5 2024