# BW Agenda Table

Day View timeline Gutenberg block for event Sessions — vertical timeline with auto single/multi-day date navigation. Self-contained, theme-agnostic, and portable across WordPress projects.

## Requirements

- WordPress 6.0 or later
- PHP 7.4 or later
- (Optional) [Advanced Custom Fields](https://www.advancedcustomfields.com/) for editing Session date / time / speakers in the admin UI. Plain post meta works as a fallback.

## Installation

1. Download or copy the `bw-agenda-table` directory into `wp-content/plugins/`.
2. WP Admin → Plugins → activate **BW Agenda Table**.
3. In the block editor, insert the **BW Agenda Table** block (Design category, "agenda" search).

Until a `session` Custom Post Type exists on the site, the block renders demo data so editors can preview the layout.

## Host-site contract

The block reads from a `session` Custom Post Type and an optional `track` taxonomy. **Neither is registered by this plugin** — your theme or another plugin owns that. Once they exist, the block switches from demo data to live content automatically.

### Custom Post Type

| Slug | Notes |
|---|---|
| `session` | Must be `public`, `show_in_rest = true`. |

### Taxonomy (optional)

| Slug | Object | Notes |
|---|---|---|
| `track` | `session` | Used for the track-filter dropdown and the colour bar. Optional term meta `color_class` overrides the default slug-based class (e.g. `track-1`, `track-2`). |

### Session fields (ACF or post meta)

The block tries common alias names so it works whether your schema is verbose or terse. First non-empty wins.

| Concept | Candidate field names |
|---|---|
| Date | `event_date`, `date`, `session_date` |
| Start time | `start_time`, `start`, `time_start` |
| End time | `end_time`, `end`, `time_end` |
| Room / venue | `room`, `venue`, `location` |
| Featured flag | `is_featured`, `featured`, `is_keynote` |
| Speakers (post object/list) | `speakers`, `speaker`, `pembicara`, `presenter`, `presenters` |
| Slides URL | `slider_url`, `slides_url`, `slides`, `slide_url`, `slide` |

### Speaker fields

If your `speakers` field returns post objects, the block reads these from each speaker post:

| Concept | Candidate field names |
|---|---|
| Company | `company`, `organization`, `organisation`, `org`, `perusahaan` |
| Role | `role`, `position`, `title`, `job_title`, `jabatan` |

## Features

- Vertical timeline grouped by start time, sorted chronologically.
- **Auto** date navigation: collapses to a static label for single-day, switches to a real day picker for multi-day events.
- Track filter, featured-only filter, limit.
- Toggle: track badge, featured badge, thumbnail, description.
- Per-track colour bars (`track-1` orange, `track-2` teal, `track-3` green by default; extend via term meta `color_class`).
- Server-side render — no client-side hydration cost; multi-day switching is progressive enhancement.

## License

GPL-2.0-or-later. See `LICENSE`.
