Template:Category/Workshop logistics/meal-day

From Miniscope
Jump to: navigation, search

Per-day meal column for Template:Category/Workshop logistics. Do not transclude directly.

Queries the logistics page's Meal service subobjects for one calendar day and renders them as a column. The parent invokes this nine times — one day before the workshop through one day after — and each invocation self-suppresses when the day has no meals, because the day heading lives in the query's intro= and SMW only emits intro/outro when the result set is non-empty. That is why there is no separate format=count probe here: one query per day does the whole job, where Template:Category/Workshop itinerary/day needs two.

The day window is a single exact-match constraint — [[Has meal day::2026-08-26]] — rather than the itinerary's ≥ … < … pair, because Has meal day is day-precision by design and carries no time component to bracket.

Why the label is passed in, not computed here

intro= is a positional-ish #ask parameter whose value is scanned for | as an argument separator in the template source. A {{#time: l, F j | … }} written inline would have its pipe eaten and break the query. So the parent computes daylabel (where the pipe is harmless, because it sits inside a normal template call) and passes the finished string. A pipe arriving inside {{{daylabel}}} is safe: MediaWiki splits arguments on raw source before substituting parameters.

Meals within a day sort by Has sort order — the counter SemanticSchemas stamps into every subobject via 1, which preserves the order the rows were written in the wikitext. Meals therefore come out in the order they were entered, with no numbering to maintain.

Has meal time could not do that job: it is free text, so "9:00 - 10:30 AM" sorts after "12:00 - 1:30 PM" as a string.

Parameters:

  • page — the logistics page holding the subobjects
  • day — the calendar day, Y-m-d
  • daylabel — pre-formatted heading text (e.g.
 Day 1 — Wed, Aug 26)