Template:PersonCall: Difference between revisions
From Bodhicitta
(VSCode edit) |
(VSCode edit) |
||
| (9 intermediate revisions by the same user not shown) | |||
| Line 21: | Line 21: | ||
< | <!-- | ||
Full width, no sidebar. | |||
NOTE — avoid colons inside these comment blocks. SMW's RemoteRequest.php | |||
runs a colon-split over every HTML comment it finds in a remote query | |||
response, so a colon here produces PHP warnings during rebuildData runs. | |||
The page used to run a 3/9 split with relations and categories in a sticky | |||
rail. Measured across all 1,695 person pages, that rail held a median of TWO | |||
items. 82% of pages carried 1-3, and only 1.2% carried 15 or more. Four out | |||
of five pages were paying for a sticky-sidebar instance, a mobile drawer, and | |||
a narrowed article column in order to show about two links. | |||
A sidebar also earns its keep elsewhere on this wiki by holding things a | |||
reader returns to while moving through long content, such as a TOC or chapter | |||
navigation. Person pages have no such content, only a short biography and | |||
then tiles. Names and relationships are attributes OF the subject, so they | |||
now read in sequence with it rather than in a parallel column. | |||
Reading order is deliberate. Who they are, what they looked like and their | |||
life, who they were connected to, then what they made. The works queries come | |||
last because they run deep on well-covered figures, and they are the point of | |||
the page. | |||
-->{{#ask:[[{{SUBPAGENAME}}]] | |||
|?BdrcLink |?Bio |?BiographicalInfo |?BioTib |?BnwShortPersonBio |?FirstImage |?HarLinkRaw |?HasDnzPage |?HasRtzPage |?ImagesRaw |?MainNameChi |?MainNameDev |?MainNameJap |?MainNameKor |?MainNamePhon |?MainNameTib |?TolExcerpt |?TolLinkRaw |?Yearbirth |?Yeardeath |?Subclass |?GyatsaBioTib |?AltNamesTib |?AltNamesWylie |?AltNamesOther |?PersonType |?Languagetranslation |?EmanationOf |?Studentof |?Teacherof | |||
|?BdrcLink |?Bio |?BiographicalInfo |?BioTib |?BnwShortPersonBio | |||
|named args=true | |named args=true | ||
|link=none | |link=none | ||
| Line 66: | Line 51: | ||
|format=template | |format=template | ||
|template=PersonRemote | |template=PersonRemote | ||
}} | }}<!-- | ||
<div class="my-4">{{#if: {{{ overrideAuthoredWorks | }}}{{{ overrideTranslatoredWorks | }}} | The Names and Connections band is rendered by the PersonRemote template on | ||
Commons, from the printouts requested above. It used to be six local ask | |||
queries here, which both duplicated data that arrives in the remote fetch | |||
anyway and depended on SetRemoteValues having imported it. | |||
--> | |||
<div class="my-4"><!-- | |||
One filter box for the whole page, sitting above every section. | |||
It is deliberately NOT per-section, because the handler in tws.js binds to every | |||
.filter-input on the page, and an input with no contentId targets | |||
.filterableContent globally — so one box per section would have each box | |||
filtering all the other sections too. A single box matches that behaviour | |||
honestly, and for most people the combined list is short anyway. | |||
Shown only once the page total passes 7, so short pages stay uncluttered. | |||
-->{{#ifexpr:{{#ask:{{#if: {{{ overrideAuthoredWorks | }}}{{{ overrideTranslatoredWorks | }}} | |||
|[[{{#arraymap: {{{ overrideAuthoredWorks | }}};{{{ overrideTranslatoredWorks | }}} |;|@@@|@@@|{{!}}{{!}}}}]] | |||
|[[Category:Library Items||Editorial Content]][[Category:{{#titleparts:{{SUBPAGENAME}}}}]] | |||
OR[[Category:Library Items||Editorial Content]][[PeopleTopics::{{#titleparts:{{SUBPAGENAME}}}}]] | |||
OR[[Category:Library Items||Editorial Content]][[Performer::{{#titleparts:{{SUBPAGENAME}}}}]] | |||
OR[[-AssociatedArticle::<q>[[Category:Tsadra Bodhicitta Audio]][[AudioPerformerName::{{#titleparts:{{SUBPAGENAME}}}}]]</q>]] | |||
}}|format=count}}>7|<div class="row mb-5 justify-content-center"> | |||
<div class="col-md-8 col-lg-6">{{#widget:filterInput|placeholder=Filter all contributions...}}</div> | |||
</div>|}}{{#if: {{{ overrideAuthoredWorks | }}}{{{ overrideTranslatoredWorks | }}} | |||
<!-- | <!-- | ||
OVERRIDE PATH — an explicit work list was passed in, so relationship | OVERRIDE PATH — an explicit work list was passed in, so relationship | ||
| Line 73: | Line 81: | ||
--> |{{PersonWorksSection | --> |{{PersonWorksSection | ||
|heading=Works & Contributions | |heading=Works & Contributions | ||
|query=[[{{#arraymap: {{{ overrideAuthoredWorks | }}};{{{ overrideTranslatoredWorks | }}} |;|@@@|@@@|{{!}}{{!}}}}]] | |query=[[{{#arraymap: {{{ overrideAuthoredWorks | }}};{{{ overrideTranslatoredWorks | }}} |;|@@@|@@@|{{!}}{{!}}}}]] | ||
}} | }} | ||
| Line 81: | Line 88: | ||
The buckets have to be mutually exclusive, because the underlying data | The buckets have to be mutually exclusive, because the underlying data | ||
overlaps | overlaps, because an item with |Performer= is ALSO auto-categorised under the | ||
performer's name. Splitting naively double-renders those tiles — measured on | performer's name. Splitting naively double-renders those tiles — measured on | ||
People/Ringu Tulku, 303 "authored" + 294 "performer" for a true union of 303. | People/Ringu Tulku, 303 "authored" + 294 "performer" for a true union of 303. | ||
They are separated on |Class= rather than by negating |Performer=, for two | They are separated on |Class= rather than by negating |Performer=, for two | ||
reasons. First, SMW's negation operators do not do set subtraction here | reasons. First, SMW's negation operators do not do set subtraction here. | ||
A negated Performer condition excludes pages that LACK the property entirely, which | |||
silently drops every text work (it zeroed out Śāntideva's 181 works in | silently drops every text work (it zeroed out Śāntideva's 181 works in | ||
testing), and | testing), and a negated Category condition was ignored outright. Second, Class is a | ||
reliable positive discriminator — every one of the 1,732 library items | reliable positive discriminator — every one of the 1,732 library items | ||
carrying a Performer value is Class=Multimedia, with no exceptions. | carrying a Performer value is Class=Multimedia, with no exceptions. | ||
So | So Multimedia is the performance bucket, and everything else is authorship. | ||
Positive conditions only, no negation. | Positive conditions only, no negation. | ||
| Line 99: | Line 106: | ||
a person with only authored works — still shows exactly one section. | a person with only authored works — still shows exactly one section. | ||
--> |{{PersonWorksSection | --> |{{PersonWorksSection | ||
|heading=Authored Works | |heading=Authored & Translated Works | ||
| | |blurb=Library items authored or translated by {{#show:{{PAGENAME}}|?MainNamePhon}}. | ||
|query=[[Category:Library Items||Editorial Content]][[Category:{{#titleparts:{{SUBPAGENAME}}}}]][[Class::Books||Articles||Classical Works||Dissertations||Tibetan Publications||Sanskrit Publications||Other Classical Publications||Editorial Content]] | |query=[[Category:Library Items||Editorial Content]][[Category:{{#titleparts:{{SUBPAGENAME}}}}]][[Class::Books||Articles||Classical Works||Dissertations||Tibetan Publications||Sanskrit Publications||Other Classical Publications||Editorial Content]] | ||
}}{{PersonWorksSection | }}{{PersonWorksSection | ||
|heading=Performances & Recordings | |heading=Performances & Recordings | ||
|blurb=Media in which {{#show:{{PAGENAME}}|?MainNamePhon}} appears as performer or teacher. | |blurb=Media in which {{#show:{{PAGENAME}}|?MainNamePhon}} appears as performer or teacher. | ||
|query=[[Category:Library Items||Editorial Content]][[Performer::{{#titleparts:{{SUBPAGENAME}}}}]][[Volumenumber::<1]] | |||
|query=[[Category:Library Items||Editorial Content]][[Performer::{{#titleparts:{{SUBPAGENAME}}}}]] | |||
}}{{PersonWorksSection | }}{{PersonWorksSection | ||
|heading=Narrated Audio | |heading=Narrated Audio | ||
|blurb=Audio recordings narrated by {{#show:{{PAGENAME}}|?MainNamePhon}}. | |blurb=Audio recordings narrated by {{#show:{{PAGENAME}}|?MainNamePhon}}. | ||
|query=[[-AssociatedArticle::<q>[[Category:Tsadra Bodhicitta Audio]][[AudioPerformerName::{{#titleparts:{{SUBPAGENAME}}}}]]</q>]] | |query=[[-AssociatedArticle::<q>[[Category:Tsadra Bodhicitta Audio]][[AudioPerformerName::{{#titleparts:{{SUBPAGENAME}}}}]]</q>]] | ||
}}{{PersonWorksSection | }}{{PersonWorksSection | ||
|heading=Works About {{#show:{{PAGENAME}}|?MainNamePhon}} | |heading=Works About {{#show:{{PAGENAME}}|?MainNamePhon}} | ||
|blurb=Scholarship and editorial content in which this person is a subject rather than an author. | |blurb=Scholarship and editorial content in which this person is a subject rather than an author. | ||
|query=[[Category:Library Items||Editorial Content]][[PeopleTopics::{{#titleparts:{{SUBPAGENAME}}}}]] | |query=[[Category:Library Items||Editorial Content]][[PeopleTopics::{{#titleparts:{{SUBPAGENAME}}}}]] | ||
}} | }} | ||
<!-- | <!-- | ||
Fallback | Fallback for when nothing matched any bucket. Preserves the original empty state. | ||
--> {{#ifexpr:{{#ask:[[Category:Library Items||Editorial Content]][[Category:{{#titleparts:{{SUBPAGENAME}}}}]] | --> {{#ifexpr:{{#ask:[[Category:Library Items||Editorial Content]][[Category:{{#titleparts:{{SUBPAGENAME}}}}]] | ||
OR[[Category:Library Items||Editorial Content]][[PeopleTopics::{{#titleparts:{{SUBPAGENAME}}}}]] | OR[[Category:Library Items||Editorial Content]][[PeopleTopics::{{#titleparts:{{SUBPAGENAME}}}}]] | ||
| Line 128: | Line 132: | ||
}} | }} | ||
</div> | </div> | ||
{{#arraymap:{{#titleparts:{{SUBPAGENAME}} }};{{#arraymap:{{#ask:[[{{PAGENAME}}]][[Languagetranslation::+]] | {{#arraymap:{{#titleparts:{{SUBPAGENAME}} }};{{#arraymap:{{#ask:[[{{PAGENAME}}]][[Languagetranslation::+]] | ||
| Line 150: | Line 151: | ||
separated from single-valued ones. | separated from single-valued ones. | ||
The GetData module now takes |multi=, an allowlist of the properties that should | |||
receive SMW's '+sep=' directive. Everything else in |props= is stored as a | receive SMW's '+sep=' directive. Everything else in |props= is stored as a | ||
single value, so both groups can travel in one query. | single value, so both groups can travel in one query. | ||