Template:SidebarPersonBadge: Difference between revisions

From Bodhicitta
(VSCode edit)
Tag: Reverted
(Space both sides of the role separator)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#ifeq:{{{ 1 | }}}|Anon||<div class="col-sm-6 col-md-12 position-relative p-3 rounded-xl" style="width: 100%;"><!--
<includeonly>{{#ifeq:{{{ 1 | }}}|Anon||<div class="sidebar-person position-relative rounded-xl"><!--
Portrait, name and roles for one person in a library-item sidebar.
Portrait, name and roles for one person in a library-item sidebar.
A horizontal row — small round avatar, then name and roles — rather than a
portrait with the name centred underneath. The old layout sized the image at
100% of the sidebar column with padding-top:100%, so every person cost about
250px of height. Two thirds of library items have exactly one person, but the
tail is long: "A Gathering of Brilliant Moons" has 26 (12 source authors, 13
translators, editors, a publisher), which ran to roughly 5,000px of sidebar.
At 48px per avatar the same list is about a fifth of the height and scans as
a list rather than a stack of posters.
48px, not smaller: these are portraits of masters that readers recognise by
face, so the avatar has to stay legible as a face.
Roles are separated by a middot rather than <br>. The row is only two lines
tall, and stacking three roles vertically would undo the saving.


The image, phonetic name and Tibetan name arrive as parameters from
The image, phonetic name and Tibetan name arrive as parameters from
Line 12: Line 27:
got nothing usable, and fell through to the placeholder for everyone. The
got nothing usable, and fell through to the placeholder for everyone. The
module now asks for ?FirstImage# and passes the raw title.
module now asks for ?FirstImage# and passes the raw title.
-->{{{ img | }}}
-->
<div class="row">
<div class="sidebar-person-avatar">{{#widget:SidebarPersonPageRoundImage
<div class="col-4 col-md-12">
|filepath={{#if: {{{ img | }}}
<div class="mx-auto" style="max-width: 200px;">{{#widget:SidebarPersonPageRoundImage
|{{#ifeq: {{{ img | }}}
|filepath={{#if: {{{ img | }}}
|File:Noimagefound.jpg
|{{#ifeq: {{{ img | }}}
|{{filepath:Teaching_Mudra_2_reduced_opacity.png|300}}
|File:Noimagefound.jpg
|{{filepath:{{#titleparts:{{PAGENAME:{{{ img | }}}}} }}|150}}
|{{filepath:Teaching_Mudra_2_reduced_opacity.png|300}}
|{{filepath:{{#titleparts:{{PAGENAME:{{{ img | }}}}} }}|300}}
}}
|{{filepath:Teaching_Mudra_2_reduced_opacity.png|300}}
}}
|size=100%
|bgSize=cover
|depth=0
}}
}}
</div>
|{{filepath:Teaching_Mudra_2_reduced_opacity.png|300}}
</div>
}}
<div class="col-8 col-md-12 pl-0 px-md-0 font-serif text-md-center d-flex align-items-center">
|size=100%
|bgSize=cover
|depth=0
}}
</div>
<div class="sidebar-person-text font-serif">
<div class="w-100">
<div class="w-100">
<div class="mt-md-2 text-150 line12">{{#if: {{{ phon | }}}
<div class="sidebar-person-name line12">{{#if: {{{ phon | }}}
|{{#if: {{{ tib | }}}
|{{#if: {{{ tib | }}}
|{{I18n
|{{I18n
Line 46: Line 58:
}}
}}
|{{{ phon | }}}
|{{{ phon | }}}
}}<!--
Organisations have no MainNamePhon; they carry Orgname instead. Without this
fallback an institutional credit shows only its raw page title.
--> |{{#if: {{{ org | }}}
|{{{ org | }}}
|[[{{{ 1 | }}}]]
}}
}}
|[[{{{ 1 | }}}]]
}}</div>
}}</div>
<div class="opac-50 mt-1 text-130 font-italic line11">{{#arraymap:{{{ 2 | }}}
<div class="sidebar-person-roles opac-50 font-italic line11">{{#arraymap:{{{ 2 | }}}
|;
|;
|@@@
|@@@
|@@@
|@@@
|<br>
|&nbsp;·&nbsp;
}}</div>{{#ifexist:{{{ 1 | }}}||{{#ifexist:People/{{{ 1 | }}}|
}}</div>{{#ifexist:{{{ 1 | }}}||{{#ifexist:People/{{{ 1 | }}}|
<div class="carnelian mb-2">redirect needed</div>{{#set:PersonNameNeedsRedirect={{{ 1 | }}}}}|
<div class="carnelian mb-2">redirect needed</div>{{#set:PersonNameNeedsRedirect={{{ 1 | }}}}}|
<div class="carnelian mb-2">page missing</div>{{#set:PersonNameNeedsPage={{{ 1 | }}}}} }} }}
<div class="carnelian mb-2">page missing</div>{{#set:PersonNameNeedsPage={{{ 1 | }}}}} }} }}
</div>
</div>
</div>
</div>{{#widget:OverlayLink
</div>{{#widget:OverlayLink
|link=/index.php/{{#ifexist:{{{ 1 | }}}
|link=/index.php/{{#ifexist:{{{ 1 | }}}
|{{{ 1 | }}}
|{{{ 1 | }}}

Latest revision as of 13:46, 25 August 2026