Code Injection JSON
Outpost adds a<script> tag with JSON data to every event post:
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
| Field | Type | Example | Description |
|---|---|---|---|
date | string | "March 15, 2026" | Formatted event date (uses site’s date format) |
event_day | string | "Sunday" | Day of the week |
start_time | string | "10:00 am" | Event start time |
end_time | string | "11:00 am" | Event end time |
time_zone | string | "America/New_York" | IANA timezone identifier |
time_zone_abbr | string | "EDT" | Localized timezone abbreviation for the event date |
location | string | "Online" | Event location/venue |
platform_url | string | "https://zoom.us/..." | Virtual event platform link |
registration_deadline | string | "March 14, 2026" | Registration cutoff date (or event date if not set) |
access | string | "anyone" | Access level enum (see below) |
event_state | string | "registration_open" | Current lifecycle state (see below) |
outpost_ghost_event_id | string | "march-2026-webinar" | Unique event identifier (GUID/slug) |
event_type | string | "webinar" | Event type key from manifest |
custom_fields | object | {...} | Custom field values defined by manifest |
Access Levels
Theaccess field indicates who can register for the event:
| Value | Description | Theme Behavior |
|---|---|---|
anyone | All logged-in members (free and paid) | Show standard registration CTA |
free | Free-tier members and above | Show registration CTA for logged-in users |
paid | Only paid subscribers | Show upgrade CTA for free members |
Example: Conditional Rendering by Access
Event States
Theevent_state field reflects the event’s current lifecycle position:
| Value | Description | Typical Theme Behavior |
|---|---|---|
registration_open | Event is upcoming, registration is open | Show registration CTA |
registration_closed | Deadline passed, event hasn’t happened | Show “Registration closed” message |
event_passed | Event date/time has passed | Show “This event has ended” message |
Example: State-Based UI
Custom Fields
Custom fields defined in the manifest are nested under thecustom_fields object. The keys match what you defined in your outpost-manifest.yaml:
Custom Field Value Types
| Manifest Type | JSON Type | Example Value |
|---|---|---|
text | string | "Jane Smith" |
textarea | string | "A longer description..." |
number | number | 60 |
select | string | "Workshop" |
url | string | "https://example.com" |
date | string | "2026-03-15" (ISO format) |
toggle | boolean | true |
image | string | "https://cdn.example.com/image.jpg" |
Event Defaults Partial
Outpost also injects messaging defaults and portal URLs via theoutpost-event-defaults.hbs partial during theme processing:
- Messaging: Default CTA text and button labels for each audience state
- 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:| Property | Value |
|---|---|
title | Event name |
custom_excerpt | Event description |
feature_image | Event featured image (if uploaded) |
custom_template | Template from manifest post_template |
tags | Merged from default_tags + event type tags |
API Endpoint for Registration
The event widget uses Outpost’s plugin API for registration. If you’re building a custom registration UI: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.
