Template:ColTilesRemote: Difference between revisions
(No braces in the comment: the preprocessor counted them and swallowed the body) |
(Images via filepath: absolute URLs, so they load on the consuming wiki) |
||
| Line 20: | Line 20: | ||
transcluded. | transcluded. | ||
Add a collection by adding a SiteTile call. |image= | Add a collection by adding a SiteTile call. Upload its image HERE, on | ||
file | commons, and pass it as imageurl=filepath:NAME|240 -- NOT as image=. | ||
That matters. A File: link renders against the wiki the markup lands on, | |||
and commons emits its own relative /thumb.php path, which 404s everywhere | |||
else. filepath: resolves here, where the file is native, and returns an | |||
ABSOLUTE https://commons.tsadra.org/... URL that works from any wiki. | |||
With no image the card falls back to the title's first letter. | |||
-->{{#ifeq: {{{#userparam|}}} | rtz.tsadra.org ||{{SiteTile | -->{{#ifeq: {{{#userparam|}}} | rtz.tsadra.org ||{{SiteTile | ||
|url=https://rtz.tsadra.org | |url=https://rtz.tsadra.org | ||
| Line 29: | Line 34: | ||
|note=The Great Treasury of Rediscovered Teachings | |note=The Great Treasury of Rediscovered Teachings | ||
|host=rtz.tsadra.org | |host=rtz.tsadra.org | ||
| | |imageurl={{filepath:Jamgon kongtrul.jpg|240}} | ||
|imgpos=50% 35% | |imgpos=50% 35% | ||
}}}}{{#ifeq: {{{#userparam|}}} | dnz.tsadra.org ||{{SiteTile | }}}}{{#ifeq: {{{#userparam|}}} | dnz.tsadra.org ||{{SiteTile | ||
| Line 37: | Line 42: | ||
|note=The Treasury of Precious Instructions | |note=The Treasury of Precious Instructions | ||
|host=dnz.tsadra.org | |host=dnz.tsadra.org | ||
| | |imageurl={{filepath:Shing rta brgyad-01-Nyingma.jpg|240}} | ||
|imgpos=50% 45% | |imgpos=50% 45% | ||
}}}}{{#ifeq: {{{#userparam|}}} | khyentselineage.tsadra.org ||{{SiteTile | }}}}{{#ifeq: {{{#userparam|}}} | khyentselineage.tsadra.org ||{{SiteTile | ||
| Line 45: | Line 50: | ||
|note=Collected Works of the Masters | |note=Collected Works of the Masters | ||
|host=khyentselineage.tsadra.org | |host=khyentselineage.tsadra.org | ||
| | |imageurl={{filepath:Jamyang Khyentse Wangpo cropped.jpg|240}} | ||
|imgpos=50% 35% | |imgpos=50% 35% | ||
}}}}{{#ifeq: {{{#userparam|}}} | dudjom.tsadra.org ||{{SiteTile | }}}}{{#ifeq: {{{#userparam|}}} | dudjom.tsadra.org ||{{SiteTile | ||
| Line 53: | Line 58: | ||
|note=The New Treasures of Dudjom | |note=The New Treasures of Dudjom | ||
|host=dudjom.tsadra.org | |host=dudjom.tsadra.org | ||
| | |imageurl={{filepath:Dudjom portrait.jpg|240}} | ||
}}}}</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 70: | Line 75: | ||
'''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><nowiki>|imageurl={{filepath:NAME.jpg|240}}</nowiki></code>, never as <code>image=</code>. A <code>File:</code> link is resolved against whichever wiki the markup ends up on, and commons emits a site-relative <code>/thumb.php?f=…</code> path that returns 403 anywhere else — so every image in the row would break. <code>filepath:</code> runs here, where the file is native, and yields an absolute URL that any wiki can load. | |||
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> | ||
Revision as of 12:08, 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 |imageurl={{filepath:NAME.jpg|240}}, never as image=. A File: link is resolved against whichever wiki the markup ends up on, and commons emits a site-relative /thumb.php?f=… path that returns 403 anywhere else — so every image in the row would break. filepath: runs here, where the file is native, and yields an absolute URL that any wiki can load.
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.