Editing Template:Card
From LOTR-TCG Wiki
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
{{#template_params:1|2}} | {{#template_params:1|2}} | ||
</noinclude><includeonly>{{#if:{{#cargo_query: | |||
tables=Cards=C,CardReleases=CR,CardReleases=ECR | |||
|join on= C.ID = CR.BaseCardID,ECR.ID = C.ID | |||
|fields= REPLACE(REPLACE(C._pageName, '/Data', ''), 'Data:', '')=PageTitle | |||
, IFNULL(CR.ImageFilename,'File:Card_Not_Found.jpg')=ImageFile | |||
, IFNULL(CR.Title,ECR.Title)=Title | |||
, IFNULL(CR.Subtitle,ECR.Subtitle)=Subtitle | |||
, IFNULL(CR.CollInfo,C.CollInfo)=CollInfo | |||
|where= CR.ID = '{{IDLookup|{{{1}}}|{{{2|EN}}}}}' | |||
|format=template | |||
|named args=yes | |||
|template=LinkNameWithImage | |||
|default={{PageLookup|{{{1}}}}} | |||
}} | |||
{{#switch:{{{1}}} | |||
|{{#pos:{{{1}}}|0}} > 0 | |||
|{{#pos:{{{1}}}|1}} > 0 | |||
|{{#pos:{{{1}}}|2}} > 0 | |||
|{{#pos:{{{1}}}|3}} > 0 | |||
|{{#pos:{{{1}}}|4}} > 0 | |||
|{{#pos:{{{1}}}|5}} > 0 | |||
|{{#pos:{{{1}}}|6}} > 0 | |||
|{{#pos:{{{1}}}|7}} > 0 | |||
|{{#pos:{{{1}}}|8}} > 0 | |||
|{{#pos:{{{1}}}|9}} > 0 | |||
|{{#pos:{{{1}}}|-}} > 0 = {{#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 21: | Line 42: | ||
|default={{PageLookup|{{{1}}}}} | |default={{PageLookup|{{{1}}}}} | ||
}} | }} | ||
| {{#cargo_query: | | #default = {{#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 29: | Line 50: | ||
, IFNULL(CR.Subtitle,ECR.Subtitle)=Subtitle | , IFNULL(CR.Subtitle,ECR.Subtitle)=Subtitle | ||
, IFNULL(CR.CollInfo,C.CollInfo)=CollInfo | , IFNULL(CR.CollInfo,C.CollInfo)=CollInfo | ||
|where= (C. | |where= (C.Subtitle LIKE '{{{1}}}' OR C.Title LIKE '{{{1}}}' OR (C.Title LIKE '{{#explode:{{{1}}}|,|0}}' AND C.Subtitle LIKE '{{#explode:{{{1}}}|,|1}}') | ||
|order by= | AND CR.LanguageCode = '{{{2|EN}}}' | ||
|order by=C.SetNum, C.CardNum | |||
|limit=1 | |limit=1 | ||
|format=template | |format=template | ||
|named args=yes | |named args=yes | ||
Line 38: | Line 59: | ||
|default={{PageLookup|{{{1}}}}} | |default={{PageLookup|{{{1}}}}} | ||
}} | }} | ||
}}</includeonly> | }} | ||
</includeonly> |