Template:SplashCard: Difference between revisions
No edit summary |
No edit summary |
||
| (8 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
{{#template_params: | {{#template_params:1|2|Lang|Size}} | ||
Parameter 1 should refer to the card. Usually this can just be the card name: ''<nowiki>{{Card|The One Ring, The Ruling Ring}}</nowiki>'' or ''<nowiki>{{Card|The Ruling Ring}}</nowiki>'' produce {{Card|The Ruling Ring}}. If you want to link to a different version of the same card, you can use the card's collector number: ''<nowiki>{{Card|4C2}}</nowiki>'' produces {{Card|4C2}}. If that doesn't work, you can instead use the "Wiki Base Card ID" parameter, found in each card page's infobox under "Technical Info". For example, using ''<nowiki>{{Card|LOTR-EN15G060.0}}</nowiki>'' is currently the only working way to link to the Gondor version {{Card|LOTR-EN15G060.0}}. | Parameter 1 should refer to the card. Usually this can just be the card name: ''<nowiki>{{Card|The One Ring, The Ruling Ring}}</nowiki>'' or ''<nowiki>{{Card|The Ruling Ring}}</nowiki>'' produce {{Card|The Ruling Ring}}. If you want to link to a different version of the same card, you can use the card's collector number: ''<nowiki>{{Card|4C2}}</nowiki>'' produces {{Card|4C2}}. If that doesn't work, you can instead use the "Wiki Base Card ID" parameter, found in each card page's infobox under "Technical Info". For example, using ''<nowiki>{{Card|LOTR-EN15G060.0}}</nowiki>'' is currently the only working way to link to the Gondor version {{Card|LOTR-EN15G060.0}}. | ||
Parameter 2 is the language code, which will produce the appropriate title + image for the requested language. ''<nowiki>{{Card|Gimli, Son of Gloin|FR}}</nowiki>'' produces {{Card|Gimli, Son of Gloin|FR}}, and ''<nowiki>{{Card|Gimli, Son of Gloin|TW}}</nowiki>'' produces the tengwar {{Card|Gimli, Son of Gloin|TW}}. | Parameter 2 is the caption being placed beneath the card image. | ||
Lang is language code, which will produce the appropriate title + image for the requested language. ''<nowiki>{{Card|Gimli, Son of Gloin|FR}}</nowiki>'' produces {{Card|Gimli, Son of Gloin|FR}}, and ''<nowiki>{{Card|Gimli, Son of Gloin|TW}}</nowiki>'' produces the tengwar {{Card|Gimli, Son of Gloin|TW}}. This defaults to EN. | |||
Size is the max width of the image, which defaults to 500px. | |||
If the card is not found (due to a typo, for instance), then it will display like this: {{Card|Glimlik, Son of Gloin}}. | If the card is not found (due to a typo, for instance), then it will display like this: {{Card|Glimlik, Son of Gloin}}. | ||
</noinclude><includeonly>{{#if:{{#pos:{{{ | </noinclude><includeonly>{{#if:{{#pos:{{{1}}}|0}}{{#pos:{{{1}}}|1}}{{#pos:{{{1}}}|2}}{{#pos:{{{1}}}|3}}{{#pos:{{{1}}}|4}}{{#pos:{{{1}}}|5}}{{#pos:{{{1}}}|6}}{{#pos:{{{1}}}|7}}{{#pos:{{{1}}}|8}}{{#pos:{{{1}}}|9}}|{{#cargo_query: | ||
tables=Cards=C,CardReleases=CR,CardReleases=ECR | tables=Cards=C,CardReleases=CR,CardReleases=ECR | ||
|join on= C.ID = CR.BaseCardID,ECR.ID = C.ID | |join on= C.ID = CR.BaseCardID,ECR.ID = C.ID | ||
| Line 13: | Line 17: | ||
, IFNULL(CR.ImageFilename,'File:Card_Not_Found.jpg')=ImageFile | , IFNULL(CR.ImageFilename,'File:Card_Not_Found.jpg')=ImageFile | ||
, '{{{Size|500}}}px'=ImageWidth | , '{{{Size|500}}}px'=ImageWidth | ||
, | , CONCAT('{{#replace:{{#replace:{{{2}}}|'|''}}|.|․}}','')=Caption | ||
|where= CR.ID = '{{IDLookup|{{{ | |where= CR.ID = '{{IDLookup|{{{1}}}|{{{Lang|EN}}}}}' | ||
|order by=CASE WHEN C.Subtitle IS NULL THEN 1 ELSE 0 END DESC, C.Title, C.Subtitle | |||
|format=template | |format=template | ||
|named args=yes | |named args=yes | ||
|template=SplashCardWithCaption | |template=SplashCardWithCaption | ||
|default={{PageLookup|{{{ | |default={{PageLookup|{{{1}}}}} | ||
}} | }} | ||
| {{#cargo_query: | | {{#cargo_query: | ||
| Line 26: | Line 31: | ||
, IFNULL(CR.ImageFilename,'File:Card_Not_Found.jpg')=ImageFile | , IFNULL(CR.ImageFilename,'File:Card_Not_Found.jpg')=ImageFile | ||
, '{{{Size|500}}}px'=ImageWidth | , '{{{Size|500}}}px'=ImageWidth | ||
, | , CONCAT('{{#replace:{{#replace:{{{2}}}|'|''}}|.|․}}','')=Caption | ||
|where= (C.Title LIKE '{{#replace:{{{ | |where= ( | ||
|order by=CASE WHEN C.SetNum = '0' THEN 100 ELSE CASE WHEN C.SETNUM REGEXP '^-?[0-9]+$' THEN CAST(C.SetNum AS UNSIGNED INTEGER) ELSE 100 END END, CASE WHEN C.Subset = 'S' THEN 0 WHEN C.Subset = 'F' THEN 1 WHEN C.Subset = 'P' THEN 0 WHEN C.Subset = 'D' THEN 1 ELSE 10 END, C.CardNum | C.Title LIKE '{{#replace:{{{1}}}|'|''}}' | ||
OR C.Subtitle LIKE '{{#replace:{{{1}}}|'|''}}' | |||
OR ( | |||
C.Title LIKE '{{#explode:{{#replace:{{{1}}}|'|''}}|, |0}}' | |||
AND C.Subtitle LIKE TRIM('{{#explode:{{#replace:{{{1}}}|'|''}}|, |1}}') | |||
) | |||
) | |||
AND CR.LanguageCode = '{{{Lang|EN}}}' | |||
|order by=CASE WHEN C.Subtitle IS NULL THEN 1 ELSE 0 END DESC, CASE WHEN C.SetNum = '0' THEN 100 ELSE CASE WHEN C.SETNUM REGEXP '^-?[0-9]+$' THEN CAST(C.SetNum AS UNSIGNED INTEGER) ELSE 100 END END, CASE WHEN C.Subset = 'S' THEN 0 WHEN C.Subset = 'F' THEN 1 WHEN C.Subset = 'P' THEN 0 WHEN C.Subset = 'D' THEN 1 ELSE 10 END, C.CardNum | |||
|limit=1 | |limit=1 | ||
|more results text= | |more results text= | ||
| Line 34: | Line 47: | ||
|named args=yes | |named args=yes | ||
|template=SplashCardWithCaption | |template=SplashCardWithCaption | ||
|default={{PageLookup|{{{ | |default={{PageLookup|{{{1}}}}} | ||
}} | }} | ||
}}</includeonly> | }}</includeonly> | ||
Latest revision as of 05:16, 6 July 2024
This is the "SplashCard" template.
It should be called in the following format:
{{SplashCard
|1=
|2=
|Lang=
|Size=
}}
Edit the page to see the template text.
Parameter 1 should refer to the card. Usually this can just be the card name: {{Card|The One Ring, The Ruling Ring}} or {{Card|The Ruling Ring}} produce The One Ring, The Ruling Ring (1C2)
. If you want to link to a different version of the same card, you can use the card's collector number: {{Card|4C2}} produces The One Ring, The Ruling Ring (4C2)
. If that doesn't work, you can instead use the "Wiki Base Card ID" parameter, found in each card page's infobox under "Technical Info". For example, using {{Card|LOTR-EN15G060.0}} is currently the only working way to link to the Gondor version Forth the Three Hunters! (15C60)
.
Parameter 2 is the caption being placed beneath the card image.
Lang is language code, which will produce the appropriate title + image for the requested language. {{Card|Gimli, Son of Gloin|FR}} produces Gimli, Fils de Glóin (1R13)
, and {{Card|Gimli, Son of Gloin|TW}} produces the tengwar Gimli, Son of Gloin (1R13T)
. This defaults to EN.
Size is the max width of the image, which defaults to 500px.
If the card is not found (due to a typo, for instance), then it will display like this: Glimlik, Son of Gloin
.