Live for Craft CMS

Installation

Requirements

  • Craft CMS 5.3 or later
  • PHP 8.2 or later
  • A web root PHP can write to, if you want static snapshots (you do — see Delivery)

Nothing else. No Redis, no socket server, no queue worker needed for publishing, and no account with a realtime service.

Install

composer require justinholtweb/craft-live
php craft plugin/install live

Or find Live in the Craft Plugin Store and install it from there.

Installing creates one update type, called Update, so the composer has a button on it from the start.

Editions

Lite is a complete live blog, not a demo of one. Pro is what a newsroom needs on top of it: other editors, a clock, a CDN and an API.

LitePro
Composer, update types, Twig, static snapshots, polling●●
Pinning, key moments, states●●
Other editors' presence●
Scheduled and embargoed updates●
Server-sent events●
CDN purging (Cloudflare, Fastly, webhook)●
GraphQL●

Lite is free. Pro is $99, with a $79/year renewal for updates.

Switching from Pro back to Lite loses no content: posts, updates and update types stay as they are, and the Pro features switch off. GraphQL is only registered on Pro, so Live's queries disappear from the schema rather than answering with an error.

Setting up

1. Add a Live field

Create a field of type Live and add it to any entry type's field layout. That entry can now be live-blogged, and the field's input in the entry editor is the composer.

The field stores nothing in the entry's content. Updates are elements of their own, keyed on the entry, so adding the field to an entry type is free and removing it loses nothing.

2. Add update types

Open Live → Update Types. Each type is a button in the composer and can have its own field layout: a Goal that asks for a scorer, a Photo that asks for an image, a Quote that asks who said it.

Update types are project config, so they deploy with the rest of your schema. Like Craft's own entry types they are an admin's to change, and only where allowAdminChanges is on. See Usage.

3. Render the feed

{% include 'live/_feed.twig' with { feed: entry.commentary } %}

That is a working live blog: server-rendered on first paint, updating itself afterwards. commentary is your Live field's handle.

4. Give people permission

Under Settings → Users → User Groups, the Live heading has:

  • View live posts
    • Publish updates
      • Edit other people's updates
      • Delete updates
    • Start, pause and end live posts

These are on top of the entry's own permissions, not instead of them. Publishing, editing, pinning and deleting also need permission to edit the entry; following the feed in the control panel needs permission to view it.

Uninstalling

Uninstalling removes Live's tables and its updates. Snapshot files left in the web root can be deleted by hand: they live under web/live-feed/ unless you moved them.