Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/purdue/purdue-calendar-embed/archive/refs/heads/main.zipA WordPress block that renders Localist events from the events.purdue.edu RSS feed, with the Localist widget embed available as a fallback rendering mode.
Requires WordPress 6.5+ and PHP 8.1+.
Installing
Download purdue-calendar-embed-<version>.zip from the
latest release and install it
with Plugins → Add New → Upload Plugin, or unzip it into wp-content/plugins/. Then activate
Purdue Calendar Embed.
You can also git clone the repository into wp-content/plugins/purdue-calendar-embed/. build/
is committed and there are no runtime Composer dependencies, so no build tools are needed on the
server either way.
The folder name matters. WordPress identifies the plugin as purdue-calendar-embed/index.php, so a
copy in a different folder (for example the purdue-calendar-embed-main folder that GitHub's
Download ZIP creates) is treated as a different plugin. The release zip already has the right
folder name.
Sites that are not managed with Composer don't update automatically. To upgrade, install the new release zip over the old one.
Support
Report bugs and request features in GitHub issues. For questions, email Purdue Marketing and Communications at digital-marketing@groups.purdue.edu.
Getting started
composer install
npm install
npm run build
For local development against a throwaway WordPress install:
npm run env start # requires Docker (or Colima)
npm start # rebuild on change
Using the block
Activate the plugin on the site. In the block inserter the block is Purdue Calendar, under Widgets (not the theme's Purdue category); searching "calendar", "events" or "localist" also finds it.
The step-by-step guide for site editors is the Website Integration → WordPress section of Brand Studio's Events Calendar page. It covers widget mode only for now. Keep it in step with this README when the editor experience changes.
Feed-mode times are shown in the site's timezone (Settings → General). A site left on UTC shows every event four or five hours late.
Event titles are headings. Set Display → Event title heading level to the level that follows the heading above the block, so the page's heading outline stays in order. The default is H3.
With purdue-home-theme
The block needs nothing from purdue-home-theme, Purdue's WordPress theme. The plugin registers
purdue/calendar and ships its own stylesheet, so it works under any theme.
Do not add calendar to the theme's $purdueBlocks list in inc/blocks.php. That list is for
blocks built inside the theme, and the theme deregisters every purdue-<block>-* asset handle in
it. Those include purdue-calendar-style and purdue-calendar-editor-script, which are this
plugin's handles, so the block would lose its styles on the front end and its script in the
editor. For the same reason, the theme must never get a block of its own named calendar.
The two modes
The block has one setting that matters more than the rest: Mode.
Feed mode (default)
PHP fetches calendar.xml, normalizes each item, caches the result, and server-renders the
list. This is the mode to use — the markup is yours, it is cacheable, and it works with the
site's own styles.
The feed links each event photo at Localist's "huge" size (580–750 px, often 100–400 KB). In the
list layout, which shows a 128×96 thumbnail, the block requests Localist's 4:3 "big" (200×150)
and "big_300" (300×225) sizes instead through srcset. That cuts photo weight roughly eightfold.
The cards layout shows photos much wider and keeps the "huge" size.
Widget mode
You paste the embed snippet that Localist's widget builder generates (or just the widget URL)
and the block reproduces it. Use this when you need something the RSS feed cannot express — most
often days and num, which /widget/view honours and calendar.xml ignores.
Only the script URL is saved, in the widgetUrl attribute. The paste box is not saved: after a
reload it is empty, and the Using widget URL notice below it shows what the block will render.
The snippet cannot be stored because WordPress runs block attributes through KSES on save and
strips `