Emmanuel Lutheran Church

Custom Planning Center
Calendar Widget

A self-contained, embeddable calendar widget powered by the Planning Center Online API. One <script> tag delivers an interactive calendar with month navigation, multiple view layouts, event popovers, tag-based color coding, iCal downloads, and smooth transitions — all configurable via data attributes and server-side feature flags. Designed for seamless embedding on Squarespace, static sites, or any web platform.


Feature Flags (env.json)

All engagement features are toggled server-side in private/env.json. The server embeds the flags into the first HTML response; the widget extracts them automatically. Toggle any feature to false to disable it globally.

env.json Key Feature Description Status
WIDGET_POPOVER Event Popover Click any event in the month grid to see full details, image, and action buttons ON
WIDGET_TRANSITIONS Slide Transitions Smooth slide animation when navigating between months ON
WIDGET_ICAL Add to Calendar Download .ics files from popovers; "+ Calendar" links on cards and list rows ON
WIDGET_TAG_COLORS Tag Color Coding Events are color-coded by their PCO tag (Worship = blue, Youth = purple, etc.) ON
WIDGET_THIS_WEEK Week View Adds a "Week" view button showing this month's events in compact list format ON
{ "WIDGET_POPOVER": true, "WIDGET_TRANSITIONS": true, "WIDGET_ICAL": true, "WIDGET_TAG_COLORS": true, "WIDGET_THIS_WEEK": true }

Default Widget (Month Grid)

One script tag — gets you month navigation, view switching (Month / Week / List / Cards), event popovers, slide transitions, tag color coding, and iCal downloads. This is what Squarespace embeds.

<script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js"></script>
Features to validate
Month nav: Click left/right arrows to change months — watch for slide transitions
Today button: Click the month name to return to current month
View switching: Month | Week | List | Cards buttons in toolbar
Popover: Click any event in the month grid to see detail card with image, description, and actions
Tag colors: Events should be color-coded (blue = Worship, purple = Youth, etc.)
Featured stars: Featured events show a burgundy ★ star
Outside days: Previous/next month days shown in light gray
iCal: Popover has "Add to Calendar" button; Cards/List views show "+ Calendar" links
Drop shadow: Blue-tinted shadow, diffused toward bottom-right (also available in burgundy and standard gray via data-shadow)

Widget Filtered by Tag

Filtered to only show "Worship Services" events via data-tag. Shows a heading above the toolbar with the tag name. Tag color coding should apply — Worship Services = blue tones.

<script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js" data-tag="Worship Services"></script>



Widget Starting in Week View

Opens in the "Week" view by default — a compact list showing this month's events. The "Week" button in the toolbar should be active. This feature requires WIDGET_THIS_WEEK=true in env.json.

<script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js" data-layout="week"></script>

Widget Starting in List View

Opens in List layout by default. Shows event thumbnails, details, and "+ Cal" iCal links on each row. User can still switch to Month, Week, or Cards.

<script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js" data-layout="list"></script>

Widget Starting in Cards View

Opens in Cards layout by default. Each event card shows image, date badge, title, time, description, location, tags, and "+ Calendar" link. Featured events display a burgundy star. Tag badges are color-coded.

<script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js" data-layout="cards"></script>

Shadow Color Variants

Choose a shadow color via data-shadowblue (default, brand primary), burgundy (brand accent), or standard (neutral gray). The shadow is defined, diffused, and offset slightly to the bottom-right for depth.

Standard (Gray)

<script src="..." data-shadow="standard"></script>

Burgundy

<script src="..." data-shadow="burgundy"></script>
Note
The blue shadow is the default (shown in all widgets above). The shadow is a deeper, more diffused effect offset toward bottom-right. Border color also tints to match the shadow for a cohesive look.

Raw HTML Layouts (no widget)

These fetch format=html directly from the endpoint — returns self-contained HTML + CSS. No interactivity, no navigation. Useful for static embeds or email newsletters.

Cards Layout

?format=html&layout=cards&limit=6
Loading cards...

List Layout

?format=html&layout=list&limit=6
Loading list...

Table Layout (Month Grid)

?format=html&layout=table&limit=50
Loading calendar grid...

Featured Cards

?format=html&layout=cards&featured=1&limit=6

Featured List

?format=html&layout=list&featured=1&limit=6

Featured Table (Month Grid)

?format=html&layout=table&featured=1&limit=50

Raw JSON Response

The format=json response — raw event data for custom integrations. Includes event name, dates, description, location, image, tags, featured status, URLs, and feature flags in meta.

Loading JSON...

API Endpoint Parameters

All parameters accepted by https://elc-poc.compedgesolutions.us/api/v1/calendar-endpoint.php

Param Values Default Description
format html | fragment | json html Response format — html includes wrapper + CSS, fragment is layout-only, json is raw data
layout cards | list | table | week cards Visual layout for html/fragment formats
filter future | past | (empty) future Time filter — omitted when month is specified
tag (PCO tag name) (none) Filter events by Planning Center tag
featured 1 (none) Show only featured events
limit 1–50 10 Max events returned
month YYYY-MM (none) Explicit month — auto-sets after/before date range
after YYYY-MM-DD (none) Date range start
before YYYY-MM-DD (none) Date range end

Widget Data Attributes

Configuration via data-* attributes on the <script> tag.

Attribute Example Description
data-api https://elc-poc.compedgesolutions.us/.../calendar-endpoint.php API endpoint URL (auto-detected from script src)
data-layout table | list | cards | week Initial view (default: table)
data-tag Worship Services Filter by PCO tag name
data-featured 1 Show only featured events
data-limit 50 Max events per fetch (default: 50)
data-shadow blue | burgundy | standard Shadow color theme (default: blue)
data-include-past false | true Show finished events? (default: false — hides past events)
data-target myDiv Mount into existing element by ID instead of auto-creating
<!-- Full example with all attributes --> <script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js" data-layout="cards" data-tag="Youth" data-featured="1" data-limit="20" data-shadow="blue" data-include-past="false" data-target="my-calendar-container"> </script>

Usage Guide & Examples

How to embed the calendar widget on any page. One <script> tag is all you need. Configure behavior with data-* attributes directly on the script tag.

Quick Start
Copy and paste a single script tag into your page. The widget auto-detects the API endpoint from its own src URL, injects its own CSS, and renders into the page. No build tools, no dependencies, no configuration files required.

Basic Embed (Minimal)

The simplest embed — shows a full-month calendar grid with all future events. Past events are hidden by default.

<!-- Basic calendar — month grid, all future events, past hidden --> <script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js"></script>

Show Past Events

Include data-include-past="true" to display events that have already finished. Useful for archive pages or reviewing a full month's schedule.

<!-- Show all events in the month, including past --> <script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js" data-include-past="true"></script>

Week View (7-Day Calendar Strip)

Opens in a compact 7-day view showing just the current week from the month grid. Perfect for sidebars or a "this week at church" section.

<!-- Week view — shows 7-day row from the month grid --> <script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js" data-layout="week"></script>

Cards Layout

Rich event cards with images, date badges, descriptions, and action links. Great for a "What's Happening" section.

<!-- Cards layout — rich event cards with images --> <script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js" data-layout="cards"></script>

List Layout

Compact rows with thumbnails and event details. Good for event listings with moderate detail.

<!-- List layout — compact rows with thumbnails --> <script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js" data-layout="list"></script>

Filtered by Tag

Show only events tagged with a specific Planning Center tag name. The tag heading appears above the toolbar.

<!-- Only Worship Services events --> <script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js" data-tag="Worship Services"></script> <!-- Only Youth events in cards layout --> <script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js" data-tag="Youth" data-layout="cards"></script>

Featured Events Only

Show only events marked as "featured" in Planning Center. Featured events display a burgundy ★ star indicator.

<!-- Featured events in cards layout --> <script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js" data-featured="1" data-layout="cards"></script>

Combined Filters (Featured + Tag)

Combine data-featured and data-tag to show only events that match both.

<!-- Featured Worship Services in list layout --> <script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js" data-featured="1" data-tag="Worship Services" data-layout="list"></script>

Shadow Styling

Choose from three shadow color presets. The shadow is diffused and offset to the bottom-right.

<!-- Brand blue shadow (default — no attribute needed) --> <script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js"></script> <!-- Burgundy (brand accent) shadow --> <script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js" data-shadow="burgundy"></script> <!-- Standard gray shadow --> <script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js" data-shadow="standard"></script>

Mount into Existing Element

By default the widget creates its own container. Use data-target to render inside an existing element.

<!-- Create a container, then target it --> <div id="my-calendar"></div> <script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js" data-target="my-calendar"></script>

Full Kitchen Sink Example

All attributes at once — this is the maximum configuration.

<script src="https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js" data-layout="cards" data-tag="Youth" data-featured="1" data-limit="20" data-shadow="burgundy" data-include-past="true" data-target="my-calendar-container"> </script>
Parameter Defaults (when omitted)
data-layout = table (month grid)  |  data-shadow = blue  |  data-limit = 50  |  data-include-past = false
data-tag = (none — show all tags)  |  data-featured = (none — show all events)  |  data-target = (auto-create)  |  data-api = (auto-detected from script src)
Deployment Notes
• The widget script is hosted at https://elc-poc.compedgesolutions.us/api/v1/calendar-widget.js
• It auto-detects the API endpoint from its own src URL — no data-api needed
• For cross-origin embedding (e.g., Squarespace), the host domain must be in the CORS whitelist
• Feature flags (popover, transitions, iCal, tag colors, week view) are controlled server-side in env.json
• Multiple widget instances can coexist on the same page, each with different configurations