Difference between revisions of "Template:Card table"
Dinoguy1000 (talk | contribs) (got the name wrong on the var that indicates whether the current table is the first on a page, so just change the "correct" instance to the name I thought it was (since generally we use underscores for var names anyways)) |
Dinoguy1000 (talk | contribs) (fix) |
||
Line 5: | Line 5: | ||
}}{{ #vardefine: $ct_max_width | {{ #iferror: {{ #ifexpr: {{ #var: $ct_max_width }} > 400 | 400 | {{ #var: $ct_max_width }} }} | 200 }} | }}{{ #vardefine: $ct_max_width | {{ #iferror: {{ #ifexpr: {{ #var: $ct_max_width }} > 400 | 400 | {{ #var: $ct_max_width }} }} | 200 }} | ||
}}{{ #vardefine: $ct_width | {{px|{{{width}}}}} | }}{{ #vardefine: $ct_width | {{px|{{{width}}}}} | ||
− | }}{{ #vardefine: $ct_width | {{ #iferror: {{ # | + | }}{{ #vardefine: $ct_width | {{ #iferror: {{ #ifexpr: {{ #var: $ct_width }} > 0 }} | {{ #imgw: {{ #var: $ct_img }} }} | {{ #var: $ct_width }} }} |
}}{{ #vardefine: $ct_width | {{ #ifexpr: {{ #var: $ct_width }} < {{ #var: $ct_max_width }} | {{ #var: $ct_width }} | {{ #var: $ct_max_width }} }} | }}{{ #vardefine: $ct_width | {{ #ifexpr: {{ #var: $ct_width }} < {{ #var: $ct_max_width }} | {{ #var: $ct_width }} | {{ #var: $ct_max_width }} }} | ||
}}{{ #if: {{{image_right|}}} | }}{{ #if: {{{image_right|}}} | ||
Line 12: | Line 12: | ||
}}{{ #vardefine: $ct_max_width_right | {{ #iferror: {{ #ifexpr: {{ #var: $ct_max_width_right }} > 400 | 400 | {{ #var: $ct_max_width_right }} }} | 200 }} | }}{{ #vardefine: $ct_max_width_right | {{ #iferror: {{ #ifexpr: {{ #var: $ct_max_width_right }} > 400 | 400 | {{ #var: $ct_max_width_right }} }} | 200 }} | ||
}}{{ #vardefine: $ct_width_right | {{px|{{{width_right}}}}} | }}{{ #vardefine: $ct_width_right | {{px|{{{width_right}}}}} | ||
− | }}{{ #vardefine: $ct_width_right | {{ #iferror: {{ # | + | }}{{ #vardefine: $ct_width_right | {{ #iferror: {{ #ifexpr: {{ #var: $ct_width_right }} > 0 }} | {{ #imgw: {{ #var: $ct_img_right }} }} | {{ #var: $ct_width_right }} }} |
}}{{ #vardefine: $ct_width_right | {{ #ifexpr: {{ #var: $ct_width_right }} < {{ #var: $ct_max_width_right }} | {{ #var: $ct_width_right }} | {{ #var: $ct_max_width_right }} }} | }}{{ #vardefine: $ct_width_right | {{ #ifexpr: {{ #var: $ct_width_right }} < {{ #var: $ct_max_width_right }} | {{ #var: $ct_width_right }} | {{ #var: $ct_max_width_right }} }} | ||
}} | }} |
Revision as of 04:51, 1 July 2016
This template uses Lua: |
{{Card table}} is a metatemplate used to create card table templates.
Usage
Example
{{Card table | title = {{ #if: {{{title|}}} | {{{title}}} | {{PAGENAME}} }} | image = {{ #if: {{{image|}}} | {{{image}}} | Back-EN.png }} | label1 = [[Attribute]] | data1 = [[{{uc:{{{attribute}}}}}]] [[File:{{uc:{{{attribute}}}}}.svg|25px|alt=]] | label2 = [[Level]] | data2 = {{{level}}} {{Repeat|[[File:CG Star.svg|18px|alt=]]|{{{level}}}}} | label3 = [[Type|Type(s)]] | data3 = {{Card table/types|{{{types}}}|{{{effect_types|}}}|linked}} | label4 = [[ATK]]/[[DEF]] | data4 = {{{atk}}}/{{{def}}} | data5 = <div class="lore">{{{lore}}}</div> | label6 = Effect types | data6 = {{{effect types|}}} | label7 = Status | data7 = {{{status}}} }}