⧼social-icons-mobile-buttons⧽

Template:ColTilesRemote: Difference between revisions

From Tsadra Commons
(One shared row of collection-site cards for every collection wiki)
 
(VSCode edit)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><!--
<includeonly>{{#ifeq: {{{#userparam|}}} | rtz.tsadra.org ||{{SiteTile
One row of cards, one per Tibetan collection wiki, rendered here and shown
on every collection site. It lives on commons so the list is written ONCE:
a new collection going live is one edit here, not one edit per wiki.
 
It is fetched with an #ask carrying source=commons, and a remote #ask
resolves its row template on the SOURCE wiki -- so both this page and
Template:SiteTile have to be here, and so do the images.
 
The calling site passes its own hostname as userparam, which arrives as
{{{#userparam}}} -- hash-prefixed, and NOT as {{{userparam}}} or a numbered
slot. Each card compares it against its own host= and renders nothing when
they match, so a site never advertises itself. A caller that passes nothing
gets all four.
 
Add a collection by adding a SiteTile call. |image= is optional: upload the
file HERE, on commons, and name it; with none the card shows the title's
first letter.
-->{{#ifeq: {{{#userparam|}}} | rtz.tsadra.org ||{{SiteTile
|url=https://rtz.tsadra.org
|url=https://rtz.tsadra.org
|name=Rinchen Terdzö
|name=Rinchen Terdzö
Line 23: Line 5:
|note=The Great Treasury of Rediscovered Teachings
|note=The Great Treasury of Rediscovered Teachings
|host=rtz.tsadra.org
|host=rtz.tsadra.org
|image=File:Jamgon kongtrul.jpg
|imagefile=Jamgon kongtrul.jpg
|imgpos=50% 35%
|imgpos=50% 35%
}}}}{{#ifeq: {{{#userparam|}}} | dnz.tsadra.org ||{{SiteTile
}}}}{{#ifeq: {{{#userparam|}}} | dnz.tsadra.org ||{{SiteTile
Line 31: Line 13:
|note=The Treasury of Precious Instructions
|note=The Treasury of Precious Instructions
|host=dnz.tsadra.org
|host=dnz.tsadra.org
|image=File:Shing rta brgyad-01-Nyingma.jpg
|imagefile=Shing rta brgyad-01-Nyingma.jpg
|imgpos=50% 45%
|imgpos=50% 45%
}}}}{{#ifeq: {{{#userparam|}}} | khyentselineage.tsadra.org ||{{SiteTile
}}}}{{#ifeq: {{{#userparam|}}} | khyentselineage.tsadra.org ||{{SiteTile
Line 39: Line 21:
|note=Collected Works of the Masters
|note=Collected Works of the Masters
|host=khyentselineage.tsadra.org
|host=khyentselineage.tsadra.org
|image=File:Jamyang Khyentse Wangpo cropped.jpg
|imagefile=Jamyang Khyentse Wangpo cropped.jpg
|imgpos=50% 35%
|imgpos=50% 35%
}}}}{{#ifeq: {{{#userparam|}}} | dudjom.tsadra.org ||{{SiteTile
}}}}{{#ifeq: {{{#userparam|}}} | dudjom.tsadra.org ||{{SiteTile
Line 47: Line 29:
|note=The New Treasures of Dudjom
|note=The New Treasures of Dudjom
|host=dudjom.tsadra.org
|host=dudjom.tsadra.org
|image=File:Dudjom portrait.jpg
|imagefile=Dudjom portrait.jpg
}}}}</includeonly><noinclude>
}}}}</includeonly><noinclude>
The cards for '''Tsadra's Tibetan collection wikis''', written once and shown on all of them.
The cards for '''Tsadra's Tibetan collection wikis''', written once and shown on all of them.
Line 64: Line 46:


'''To add a collection''', add a {{tl|SiteTile}} call above, wrapped in the same <code>#ifeq</code>. Upload its image '''here''', not on the collection wiki — a remote <code>#ask</code> resolves everything on this wiki.
'''To add a collection''', add a {{tl|SiteTile}} call above, wrapped in the same <code>#ifeq</code>. Upload its image '''here''', not on the collection wiki — a remote <code>#ask</code> resolves everything on this wiki.
Pass the image as <code>|imagefile=NAME.jpg</code> — a bare file name, never <code>image=</code> and never a <code>[[File:…]]</code> link.
A <code>File:</code> link is resolved against whichever wiki the markup ends up on, and this wiki sets <code>$wgThumbnailScriptPath</code>, so its thumbnails are site-relative <code>/thumb.php?f=…</code> paths that return 403 anywhere else — every image in the row would break. <code>imagefile=</code> instead goes through <code><nowiki>{{filepath:}}</nowiki></code>, which runs here where the file is native and yields an absolute URL at the right width, and then through {{tl|RemoteImage}} — a Widget, because its output escapes the sanitiser: in running text MediaWiki autolinks a bare URL, and a raw <code>&lt;img&gt;</code> written in wikitext is escaped.


Note <code>{{{#userparam}}}</code> is hash-prefixed. <code>{{{userparam}}}</code> and the numbered slots are never set; this was tested against a remote query before the template was written.
Note <code>{{{#userparam}}}</code> is hash-prefixed. <code>{{{userparam}}}</code> and the numbered slots are never set; this was tested against a remote query before the template was written.


[[Category:Custom Templates]]</noinclude>
[[Category:Custom Templates]]</noinclude>

Latest revision as of 12:28, 14 September 2026

The cards for Tsadra's Tibetan collection wikis, written once and shown on all of them.

Each collection site renders this row with:

{{#ask:[[Template:ColTilesRemote]]
	|source=commons
	|format=template
	|template=ColTilesRemote
	|link=none
	|userparam={{SERVERNAME}}
}}

Passing commons.tsadra.org is what stops a site advertising itself: the value arrives as {{{#userparam}}} and each card compares it with its own host=.

To add a collection, add a {{SiteTile}} call above, wrapped in the same #ifeq. Upload its image here, not on the collection wiki — a remote #ask resolves everything on this wiki.

Pass the image as |imagefile=NAME.jpg — a bare file name, never image= and never a File:… link.

A File: link is resolved against whichever wiki the markup ends up on, and this wiki sets $wgThumbnailScriptPath, so its thumbnails are site-relative /thumb.php?f=… paths that return 403 anywhere else — every image in the row would break. imagefile= instead goes through {{filepath:}}, which runs here where the file is native and yields an absolute URL at the right width, and then through {{RemoteImage}} — a Widget, because its output escapes the sanitiser: in running text MediaWiki autolinks a bare URL, and a raw <img> written in wikitext is escaped.

Note {{{#userparam}}} is hash-prefixed. {{{userparam}}} and the numbered slots are never set; this was tested against a remote query before the template was written.