Template:LibraryItem: Difference between revisions
From Bodhicitta
(Defer the citations panel so it does not slow the page parse) |
(Citations panel: gate on an actual QuoteSource count instead of the RKTS DrlPageName prefix, which hid 16 cited texts without a catalogue number) |
||
| Line 282: | Line 282: | ||
CITED IN THE ŚIKṢĀSAMUCCAYA | CITED IN THE ŚIKṢĀSAMUCCAYA | ||
Renders only when this | Renders only when this page is actually quoted: at least one segment's | ||
QuoteSource names it. QuoteSource is a Page-type property, so the count is one | |||
cheap indexed lookup, and SMW resolves redirects on a page value, so a segment | |||
that named one of the text's other titles counts too. No flag to maintain, and | |||
no list to keep in sync as the alignments grow. | |||
The count is of QUOTATIONS, not segments. One quotation is often split over | The count is of QUOTATIONS, not segments. One quotation is often split over | ||
| Line 297: | Line 297: | ||
Laṅkāvatārasūtra by six. The panel groups by citing work, root texts first. | Laṅkāvatārasūtra by six. The panel groups by citing work, root texts first. | ||
Collapsed by default, and the panel itself is @deferred | Collapsed by default, and the panel itself is @deferred so the module runs | ||
after the page paints. See Template:SscCitationsDeferred. | |||
This gate used to test DrlPageName for an "RKTS" catalogue prefix, a proxy for | |||
"canonical text" from before QuoteSource was a Page. It hid every cited text | |||
without a catalogue number (16 in Oct 2026, e.g. Tathāgatakośasūtra). The | |||
module still checks Classification, so a non-text page that is named as a | |||
source renders no passages, and tws.js removes the empty panel. | |||
Keep the pipe on the same line as the expression: #ifexpr fails on a trailing | |||
newline. | |||
-->{{#ifexpr: {{#ask:[[QuoteSource::{{FULLPAGENAME}}]]|format=count}} > 0| | |||
<div class="ssc-citations-block mw-collapsible mw-collapsed" data-expandtext="Show the passages" data-collapsetext="Hide the passages"> | |||
-->{{# | |||
<div class="ssc-citations-heading"><i class="fa-sharp-duotone fa-solid fa-quote-left fa-sm mr-2"></i>Quoted in the aligned translations</div> | <div class="ssc-citations-heading"><i class="fa-sharp-duotone fa-solid fa-quote-left fa-sm mr-2"></i>Quoted in the aligned translations</div> | ||
<div class="mw-collapsible-content">{{#ask:[[{{FULLPAGENAME}}]] | <div class="mw-collapsible-content">{{#ask:[[{{FULLPAGENAME}}]] | ||