Template:UI/upcoming events list

From Miniscope
Jump to: navigation, search

"Upcoming events" right-rail list for the main page. Pairs with Template:UI/upcoming_events_featured in a .wiki-feed-columns wrapper, but renders fine on its own (e.g. as a sidebar on an Events landing page, or above the fold on a workshop hub).

Renders, top to bottom:

  • Optional <h2> heading
  • Compact card-row per upcoming event via
 Template:UI/upcoming_events_list/row (title + date/time/location
 meta + per-row "Details →" action chip)
  • Optional "See all upcoming events →" footer link

Query shape: >today, sorted ascending by start date (soonest first). The Has start date::>2026-05-13 comparison filters out past events at query time, so the visible count always matches limit (no after-fetch suppression like the activity feed's main-namespace filter needs). The category defaults to Event; pass category=Workshop (or any Event subclass) to narrow.

Why no announcement-style pinning here: the date sort already surfaces the most relevant event at the top, and the featured card on the left handles the "headline" role explicitly. A pinned-at-top mechanic would duplicate that decision.

Past-event handling: by default, events with Has start date in the past are filtered out. The simple semantic — "upcoming = future start date" — is the right cut for main-page surfaces. Note this misses currently-in-progress multi-day events (workshop started yesterday, ends tomorrow). For the typical main-page case (events announced weeks ahead, ending within a few days of start) the gap is narrow. Callers who need "upcoming OR ongoing" can pass include_past=1 to drop the filter and rely on sort order to push past events down — bumping limit compensates for the past events that consume slots.

Params:

  • heading — section heading text (default: "Upcoming
 events"). Set to empty string to suppress the h2.
  • category — Category name to filter on (no
 Category: prefix). Default: Event. Pass
 e.g. Workshop to narrow to workshops only.
  • event_type — optional Has event type
 value to filter on (e.g. Office Hours,
 Seminar, Journal Club). When set, only
 events whose type matches surface. Lets a single primitive power
 an Office Hours page, Seminars page, etc., without a bespoke
 template per type. Empty/unset = no event-type filter, every
 event in the category surfaces.
  • limit — max rows (default: 4 — fewer than the activity
 feed's 6 since each event row is taller with the per-row date+
 location meta).
  • include_past — set to any truthy value to disable the
 Has start date filter and surface past events too. Useful for an
 "All events" listing; not typical for the main page.
  • see_all — page title to link from the "See all →"
 footer. If empty, the footer is suppressed.
  • see_all_label — footer link text (default: "See all
 upcoming events →").

Co-design with Template:UI/upcoming_events_featured: the two share the .wiki-feed-columns two-column wrapper provided by Template:UI/recent_activity_feed/styles.css, so a main page that includes any of the feed pairs gets layout for free. The events list lives in its own class space (.wiki-events-list-*) parallel to .wiki-activity-list-*.