Template:LibraryItem: Difference between revisions

From Bodhicitta
(VSCode edit)
(Mobile: let the related-link / breadcrumb row wrap (it widened some item pages to 1181px on phones))
 
(7 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 255: Line 255:
|icon=book-open-reader
|icon=book-open-reader
}}
}}
|
}}<!--
CITED IN THE ŚIKṢĀSAMUCCAYA
Renders only when this text is actually quoted in the SSC. The gate is the
data itself: Module:SscCitations returns nothing unless the page carries a
DrlPageName (an RKTS catalogue id, only set on canonical texts) that appears
in a QuoteSource on an SSC segment. No flag to maintain, and no list to keep
in sync as the alignment grows.
The count is of QUOTATIONS, not segments. One quotation is often split over
several consecutive segments — the Pitāputrasamāgamanasūtra has 62 quote
segments but is quoted 14 times, and one of its runs is 36 segments long.
See the module for how the runs are collapsed.
Collapsed by default: the list is a click away, and nobody pays for it
while browsing.
-->{{#if: {{#invoke:SscCitations|count}}
|<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>Cited {{#invoke:SscCitations|count}}&nbsp;times in the ''Śikṣāsamuccaya''</div>
<div class="mw-collapsible-content">{{#invoke:SscCitations|list}}</div>
</div>
|
|
}}{{#if:{{{ BilingualPage | }}}
}}{{#if:{{{ BilingualPage | }}}
Line 301: Line 278:
|
|
}}
}}
</div>{{TileQuery
</div><!--
 
CITED IN THE ŚIKṢĀSAMUCCAYA
 
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
several consecutive segments — the Pitāputrasamāgamanasūtra has 62 quote
segments in the Śikṣāsamuccaya but is quoted 14 times, and one of its runs is
36 segments long. See the module for how the runs are collapsed.
 
Every aligned translation is searched, not just the Śikṣāsamuccaya: sixteen
carry quote data, and 53 texts are cited by more than one — the
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 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="mw-collapsible-content">{{#ask:[[{{FULLPAGENAME}}]]
|?DrlPageName
|format=template
|template=SscCitationsDeferred
|named args=yes
|link=none
|limit=1
|searchlabel=
|default=
|@deferred
}}</div>
</div>
|
}}{{TileQuery
|query=[[Category:Book Excerpts]][[Category:{{SUBPAGENAME}}||{{PAGENAME}}]]
|query=[[Category:Book Excerpts]][[Category:{{SUBPAGENAME}}||{{PAGENAME}}]]
|classes=col-md-6 mb-2 mb-md-4
|classes=col-md-6 mb-2 mb-md-4
Line 536: 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):

Latest revision as of 17:38, 8 October 2026