Template:TopicBiblioSection: Difference between revisions

From Bodhicitta
(VSCode edit)
(Pass FullTitleTib, DescriptionTib to the rows)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#ifexpr:{{#ask:{{{ query | }}}|format=count}}>0|<div class="topic-biblio-section">{{#if: {{{ heading | }}}
<includeonly>{{#ifexpr:{{#ask:{{{ query | }}}|format=count}}>0|<div class="topic-biblio-section">{{#if: {{{ heading | }}}
|<div class="h4 red-header mb-3"><span class="rel-count">{{#ask:{{{ query | }}}|format=count}}</span> {{{ heading | }}}</div>
|<div class="h4 mb-3"><span class="rel-count">{{#ask:{{{ query | }}}|format=count}}</span> {{{ heading | }}}</div>
|
|
}}<div class="topic-biblio-list">{{#ask:{{{ query | }}}
}}<div class="topic-biblio-list">{{#ask:{{{ query | }}}
|?Citation
|?Citation
|?BcaAuthor|+link=all<!--
|?BcaAuthor#=BcaAuthor<!--
link=none below keeps citations and titles as plain text, but the byline
Raw page title, not the rendered value: link=none below would otherwise
should be clickable and should read as a person's name. Without the per-
flatten the byline to plain text. The row builds the wikilink itself, and
printout override this prints the raw page title, "People/Houlton, S.",
MediaWiki then applies the person's display title, so "People/Houlton, S."
instead of the display title, "Simon Houlton".
still reads as "Simon Houlton".
-->
-->
|?Class
|?Class
Line 16: Line 16:
|?TileDescription
|?TileDescription
|?Description
|?Description
|?FullTitleTib
|?DescriptionTib
|format=template
|format=template
|template=TopicBiblioRow
|template=TopicBiblioRow
Line 22: Line 24:
|limit={{{ limit | 500 }}}
|limit={{{ limit | 500 }}}
|sort={{{ sort | Class,Citation }}}
|sort={{{ sort | Class,Citation }}}
|order={{{ order | asc,asc }}}
|order={{{ order | asc,asc }}}<!--
The deferred rows are parsed on their own, so the page-level no-glossary switch
does not reach them and the glossary marked up every chunk. A wrapper whose
class is exactly "noglossary" keeps it out: about 45% faster per chunk.
-->
|intro=<div class="noglossary">
|outro=</div>
|@deferred
|@deferred
}}</div>
}}</div>

Latest revision as of 12:01, 5 October 2026


One section of the bibliographic list on a topic page — an optional heading with a count, then the rows themselves.

Renders nothing when the query is empty, so a topic that has no Books (or no Multimedia, and so on) simply does not show that heading rather than leaving an empty section behind.

The query is @deferred, so the rows load after the page paints. On a topic with a few hundred entries that keeps the page responsive.

Parameters

Parameter Description
query SMW query for this section. Required.
heading Optional heading. Omit for a single flat list.
limit Max rows. Defaults to 500.
sort / order Passed to the query.