Template:ColTilesRemote: Difference between revisions
(Images via filepath: absolute URLs, so they load on the consuming wiki) |
(VSCode edit) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
<includeonly | <includeonly>{{#ifeq: {{{#userparam|}}} | rtz.tsadra.org ||{{SiteTile | ||
|url=https://rtz.tsadra.org | |url=https://rtz.tsadra.org | ||
|name=Rinchen Terdzö | |name=Rinchen Terdzö | ||
| Line 34: | Line 5: | ||
|note=The Great Treasury of Rediscovered Teachings | |note=The Great Treasury of Rediscovered Teachings | ||
|host=rtz.tsadra.org | |host=rtz.tsadra.org | ||
| | |imagefile=Jamgon kongtrul.jpg | ||
|imgpos=50% 35% | |imgpos=50% 35% | ||
}}}}{{#ifeq: {{{#userparam|}}} | dnz.tsadra.org ||{{SiteTile | }}}}{{#ifeq: {{{#userparam|}}} | dnz.tsadra.org ||{{SiteTile | ||
| Line 42: | Line 13: | ||
|note=The Treasury of Precious Instructions | |note=The Treasury of Precious Instructions | ||
|host=dnz.tsadra.org | |host=dnz.tsadra.org | ||
| | |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 50: | Line 21: | ||
|note=Collected Works of the Masters | |note=Collected Works of the Masters | ||
|host=khyentselineage.tsadra.org | |host=khyentselineage.tsadra.org | ||
| | |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 58: | Line 29: | ||
|note=The New Treasures of Dudjom | |note=The New Treasures of Dudjom | ||
|host=dudjom.tsadra.org | |host=dudjom.tsadra.org | ||
| | |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 76: | Line 47: | ||
'''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 | 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><img></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.