Template:LibraryItem: Difference between revisions
From Bodhicitta
(Defer the citations panel so it does not slow the page parse) |
(Mobile: let the related-link / breadcrumb row wrap (it widened some item pages to 1181px on phones)) |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 16: | Line 16: | ||
|TextTranslated={{{ TextTranslated | }}} | |TextTranslated={{{ TextTranslated | }}} | ||
|SubPagename={{#show:{{PAGENAME}}|?Display title of#}} | |SubPagename={{#show:{{PAGENAME}}|?Display title of#}} | ||
}}<div class="d-flex justify-content-between"> | }}<div class="d-flex flex-wrap justify-content-between" style="gap:0 1rem"> | ||
<div>{{#ask:[[{{PAGENAME}}]] | <div>{{#ask:[[{{PAGENAME}}]] | ||
[[Contains a full translation of::Texts/Bodhicaryāvatāra]] | [[Contains a full translation of::Texts/Bodhicaryāvatāra]] | ||
| 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}}]] | ||
| Line 562: | Line 559: | ||
| | | | ||
}};{{{ ExtraCats | }}} | }};{{{ ExtraCats | }}} | ||
}}<!-- | }}<!-- | ||
Facet categories for the site search: one per topic and one per decade. | |||
Hidden from the footer in CSS. See Module:FacetCategories. | |||
-->{{#invoke:FacetCategories|main|topics={{{ TermTopics | }}}|date={{GetItemData|prop=Pubdate}}}}<!-- | |||
Silently set SMW properties via lua (for fetched values that are straightforward): | Silently set SMW properties via lua (for fetched values that are straightforward): | ||