Skip to main content
When an event is published to Ghost, Outpost injects structured data into the post’s code injection footer. Your Ghost theme can read this data to render event details, registration CTAs, countdowns, and more.

Code Injection JSON

Outpost adds a <script> tag with JSON data to every event post:
The platform_url field is always empty. Everything in this payload is baked into the published Ghost post and is the same for every visitor, so a link meant only for registered members cannot go in it. Your theme cannot render a join link from this data. Outpost renders the join link itself, in the registration widget on the event post, and only for a member who has registered. Those members also receive the link in the event emails Outpost sends them.

Reading Data in Your Theme

JavaScript

Handlebars (with inline script)

Since Handlebars templates run server-side and the JSON is in code injection (rendered client-side), you’ll typically use JavaScript to read the data and update the DOM:

Standard Field Reference

Access Levels

The access field indicates who can register for the event:

Example: Conditional Rendering by Access

Event States

The event_state field reflects the event’s current lifecycle position:

Example: State-Based UI

Custom Fields

Custom fields defined in the manifest are nested under the custom_fields object. The keys match what you defined in your outpost-manifest.yaml:

Custom Field Value Types

Event Defaults Partial

Outpost also injects messaging defaults and portal URLs via the outpost-event-defaults.hbs partial during theme processing:
This provides:
  • Messaging: The site’s default text and display options for each registration state. There is one entry per state, and the states do not all use the same keys, so read the specific state you need rather than writing code that expects every state to look the same. The four sign-up states, can_register, login_required_free, login_required_paid and upgrade_required, each have cta_text, button_text, button_link and show_signin. The registered state has the confirmation and pending-link text plus the calendar, share and cancel options. The registration_closed state has a single message, and event_passed has a single hide_registration flag.
  • URLs: Ghost portal links for sign-in, sign-up, and account/upgrade

Reading Event Defaults

Complete Theme Example

Here’s a complete example of rendering event data in a custom Ghost template:

Ghost Post Properties

In addition to code injection, Outpost sets these Ghost post properties: Tags are written once, when Outpost first creates the Ghost post for an event. Changing any of the three sources afterwards does not retag events that already have posts. These are accessible via standard Ghost Handlebars helpers:

Event Ordering and Publish Dates

Ghost orders posts by publish date, so Outpost automatically adjusts event posts’ published_at values to keep publish-date order in sync with event-date order. The reorder runs every time an event is published or its date changes. Two consequences for theme authors:
  1. Events listings need no special sorting. A collection or channel of event posts in Ghost’s default published_at desc order shows events in event-date order: the latest-dated event first, with past events sinking to the bottom. Don’t try to sort by event date yourself; the data isn’t available in listing context anyway.
  2. Don’t display publish dates on event posts or event cards. Because Outpost manages these timestamps, {{date published_at}} on an event can show a date unrelated to when it was actually published. Hide the publication date in your event post template and on event cards, and show the event date from the code injection JSON instead:

API Endpoint for Registration

The event widget uses Outpost’s plugin API for registration. If you’re building a custom registration UI:
The apiKey is your site’s Outpost GUID (available in the outpost-api-key.hbs partial). The memberUid is the logged-in member’s Ghost UUID. Registration and cancellation requests are rate limited. One IP address can send 30 of these requests a minute to any one site, and a site can send 120 a minute in total, counted together with the contact form and the address form. Past either limit the request comes back with a 429 status and no registration is recorded, so a custom registration UI should check the response status and ask the reader to try again in a moment rather than assume the call worked. The calendar download, the call that reads an event’s registration state, and the %EVENT_CANCEL_LINK% cancel-registration link Outpost puts in event emails are not on this limit.