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)) |
||
| (13 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 30: | Line 30: | ||
}}{{#if:{{{ SubTheme | }}}|{{SubThemesList | }}{{#if:{{{ SubTheme | }}}|{{SubThemesList | ||
|{{BASEPAGENAME}} | |{{BASEPAGENAME}} | ||
|{{{ SubTheme | }}} | |{{FirstValueOfArray|{{{ SubTheme | }}}|;}} | ||
|{{#ifeq:{{{ SubTheme | }}}|SSC Chapter Summaries | |{{#ifeq:{{{ SubTheme | }}}|SSC Chapter Summaries | ||
|Articles/Chapter 1: Giving One's Body, Possessions, and Virtues;Articles/Chapter 2: Upholding the Dharma from the Perfection of Discipline;Articles/Chapter 3: Perfection of Discipline: Protecting the Dharma Teacher;Articles/Chapter 4: Perfection of Discipline: Discussion of Major Harms in the Sūtras;Articles/Chapter 5: Perfection of Discipline: Avoiding the Harms;Articles/Chapter 6: Protecting the Body;Articles/Chapter 7: Protecting the Possessions and Merit;Articles/Chapter 8: Expiation of Sinful Actions;Articles/Chapter 9: Perfection of Patience;Articles/Chapter 10: Perfection of Effort;Articles/Chapter 11: Praise of Wilderness;Articles/Chapter 12: Purifying the Mind;Articles/Chapter 13: Mindfulness;Articles/Chapter 14: Purification of the Body;Articles/Chapter 15: Purification of Possessions and Merit;Articles/Chapter 16: Enhancement of Body, Possessions, and Merit;Articles/Chapter 17: Benefit of Prostration and Other Practices;Articles/Chapter 18: Recollecting the Three Jewels;Articles/Chapter 19: Enhancing Merit | |Articles/Chapter 1: Giving One's Body, Possessions, and Virtues;Articles/Chapter 2: Upholding the Dharma from the Perfection of Discipline;Articles/Chapter 3: Perfection of Discipline: Protecting the Dharma Teacher;Articles/Chapter 4: Perfection of Discipline: Discussion of Major Harms in the Sūtras;Articles/Chapter 5: Perfection of Discipline: Avoiding the Harms;Articles/Chapter 6: Protecting the Body;Articles/Chapter 7: Protecting the Possessions and Merit;Articles/Chapter 8: Expiation of Sinful Actions;Articles/Chapter 9: Perfection of Patience;Articles/Chapter 10: Perfection of Effort;Articles/Chapter 11: Praise of Wilderness;Articles/Chapter 12: Purifying the Mind;Articles/Chapter 13: Mindfulness;Articles/Chapter 14: Purification of the Body;Articles/Chapter 15: Purification of Possessions and Merit;Articles/Chapter 16: Enhancement of Body, Possessions, and Merit;Articles/Chapter 17: Benefit of Prostration and Other Practices;Articles/Chapter 18: Recollecting the Three Jewels;Articles/Chapter 19: Enhancing Merit | ||
| Line 136: | Line 136: | ||
|<div class="col-12"> | |<div class="col-12"> | ||
|{{#if:{{{ FrontCoverImg | }}} | |{{#if:{{{ FrontCoverImg | }}} | ||
|<div class="col-md-3">[[File:{{PAGENAME:{{{ FrontCoverImg | }}}}}| | |<div class="col-md-3 tws-lightbox"><!-- | ||
No link= on the cover: an empty link= suppresses the anchor entirely, and | |||
the anchor is what the lightbox binds to. Left as a normal file link it | |||
targets the file page, which is also where MediaWiki emits the | |||
.mw-file-source href the lightbox reads the full-size URL from. | |||
See the .tws-lightbox handler in tws.js. | |||
300px, not 500px. MediaWiki puts the ORIGINAL file in the srcset once the | |||
1.5x or 2x variant would exceed the image's native width, and most covers | |||
here are under 750px wide — so a 500px request made every Retina display | |||
download the full file on page load, up to 3MB. The lightbox fetches the | |||
original on click, which is the point of it. The slot is col-md-3, so 300px | |||
is ample anyway. | |||
-->[[File:{{PAGENAME:{{{ FrontCoverImg | }}}}}|300px|class=w-100 h-auto rounded tsdwiki-depth-1 mb-4]]</div> | |||
<div class="col-md-9"> | <div class="col-md-9"> | ||
|{{GetItemData | |{{GetItemData | ||
|prop=FrontCoverImg | |prop=FrontCoverImg | ||
|intro=<div class="col-md-3 pt-4"> | |intro=<div class="col-md-3 pt-4 tws-lightbox"> | ||
|outro=</div><div class="col-md-9"> | |outro=</div><div class="col-md-9"> | ||
|map={{lb}}{{lb}}@@@{{!}} | |map={{lb}}{{lb}}@@@{{!}}300px{{!}}class=w-100 h-auto rounded tsdwiki-depth-1 mb-4{{rb}}{{rb}} | ||
|default=<div class="col-12"> | |default=<div class="col-12"> | ||
}} | }} | ||
| Line 265: | 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 382: | Line 441: | ||
ran straight on from the table of contents band with nothing between them. | ran straight on from the table of contents band with nothing between them. | ||
Centred with a byline under it, and plenty of room above: this is the seam | |||
between the work itself and everything connected to it, so it reads as a | |||
break in the page rather than as one more section heading. | |||
Hidden by CSS when nothing follows it. The sections below come from | Hidden by CSS when nothing follows it. The sections below come from | ||
| Line 390: | Line 450: | ||
renders the area but no rows. tws.js drops the heading when it comes up | renders the area but no rows. tws.js drops the heading when it comes up | ||
empty, once the deferred rows have landed. | empty, once the deferred rows have landed. | ||
--><div class="work-rels"><div class="work-rels-heading"> | --><div class="work-rels"><div class="work-rels-heading"><div class="work-rels-title">Interconnections</div><div class="work-rels-byline">Works related to this item</div></div>{{#ifeq:{{SUBPAGENAME}} | ||
|Bodhicaryāvatāra | |Bodhicaryāvatāra | ||
|<table id="RelationshipsContent" class="smwtable-clean th-top-right th-nowrap border w-100 mw-collapsible"> | |<table id="RelationshipsContent" class="smwtable-clean th-top-right th-nowrap border w-100 mw-collapsible"> | ||
| Line 499: | 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): | ||