Template:PersonWorksSection

From Bodhicitta


Purpose

Renders one relationship-scoped block of works on a person page: a header carrying the count ("294 Performances & Recordings") and the tile grid itself.

The whole block renders nothing at all when the query returns no results, which is what makes the hybrid layout on Template:PersonCall work — a person with only authored works gets exactly one section, while someone who both wrote and narrated gets a labelled section for each.

Parameters

Parameter Description
query SMW query for this section. Required.
heading Section header text, shown after the count. Defaults to "Works".
blurb Optional italic line under the header, to explain the relationship.
limit Max tiles. Defaults to 108.
sort / order Passed through to Template:TileQuery.

Filtering

This template deliberately does not emit its own filter box. Template:PersonCall places a single filter above all sections instead, which filters every section at once.

That is not just a layout preference. The handler in tws.js binds to every .filter-input on the page, and an input without a contentId targets .filterableContent globally — so one box per section would leave each box filtering all the other sections too. Genuine per-section filtering would need a unique id per section plus a matching wrapper id, and is only worth it if a single person's sections ever get long enough to warrant it.

Note on counts

The count query runs twice inside this template (the visibility test and the header). SMW caches identical queries within a single parse, so this costs one lookup rather than two. It is written out longhand because the Variables extension is deliberately not installed on this wiki.