Template:ColTilesRemote: Difference between revisions
(One shared row of collection-site cards for every collection wiki) |
(No braces in the comment: the preprocessor counted them and swallowed the body) |
||
| Line 8: | Line 8: | ||
Template:SiteTile have to be here, and so do the images. | Template:SiteTile have to be here, and so do the images. | ||
The calling site passes its own hostname as userparam | The calling site passes its own hostname as userparam. It arrives under the | ||
HASH-PREFIXED name -- see the documentation below; the plain name and the | |||
numbered slots are never set. 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. | |||
No braces in this comment: the preprocessor counts them even inside one, so | |||
a triple-brace parameter named here leaves an unbalanced opener and | |||
swallows the rest of the template. That is exactly what happened when this | |||
page was first written -- it rendered four tiles as raw text and zero when | |||
transcluded. | |||
Add a collection by adding a SiteTile call. |image= is optional: upload the | Add a collection by adding a SiteTile call. |image= is optional: upload the | ||
Revision as of 11:38, 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.
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.