Template:LibraryItem: Difference between revisions

From Bodhicitta
(VSCode edit)
(VSCode edit)
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: the list is a click away, and nobody pays for it
Collapsed by default, and the panel itself is @deferred: the module reads
while browsing.
every quote segment on the wiki, which takes seconds, so it runs after the
-->{{#if: {{#invoke:SscCitations|count}}
page paints rather than inside the parse. See Template:SscCitationsDeferred.
 
The gate is now DrlPageName rather than a count, because asking for a count
would run the module during the parse and undo the deferral. Any canonical
text carries that property, so a few pages will open the panel to nothing —
acceptable next to adding seconds to every one of them.
-->{{#if: {{GetItemData|prop=DrlPageName}}
|<div class="ssc-citations-block mw-collapsible mw-collapsed" data-expandtext="Show the passages" data-collapsetext="Hide the passages">
|<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 {{#invoke:SscCitations|count}}&nbsp;times in {{#invoke:SscCitations|works}}&nbsp;aligned {{#ifeq:{{#invoke:SscCitations|works}}|1|work|works}}</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">{{#invoke:SscCitations|list}}</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>
</div>
|
|

Revision as of 14:44, 28 August 2026