Changes

Jump to: navigation, search

Template:Card table

2,333 bytes added, 5 years ago
document the image validation stuff in a comment; support up to 20 rows instead of just 15 (needed for {{Anime card}} and I think it'll be needed for CT2 as well)
{{ #if: {{{header16header21|}}}{{{headerstyle16headerstyle21|}}}{{{label16label21|}}}{{{labelstyle16labelstyle21|}}}{{{data16data21|}}}{{{datastyle16datastyle21|}}}{{{class16class21|}}}{{{rowclass16rowclass21|}}}
| <div class="error">Error: too many rows!</div>[[Category:Card table transclusions with too many rows]]
}}<!-- image validation code the width validation especially is pretty convoluted, so here's what it's trying to do (ignoring most error checking):* <max width> is 200px* this can be overwritten with {{{max_width(_right)}}}, but this has a hardcoded maximum of 400px* check if an image's <native width> is less than <max width>* if there's a <specified width>, check that it's smaller than <max width> and larger than 0px* if there's a valid <specified width>, use it; otherwise, use the smaller of <native width> or <max width> the image itself is also confirmed to exist, by checking if its <native width> is 0px; if so, a default backing image (File:Back-EN.png) is used instead, with a link to the upload form for the specified image -->{{ #if: {{{image_raw|}}} || {{ #vardefine: $ct_img | {{PAGENAME:{{{image|}}}}}
}}{{ #if: {{ #var: $ct_img }} | {{ #ifeq: {{ #imgw: {{ #var: $ct_img }} }} | 0 | {{ #vardefine: $ct_img_name | {{ #var: $ct_img }} }}{{ #vardefine: $ct_img | Back-EN.png }} }}
}}{{ #vardefine: $ct_max_width | {{px|{{{max_width}}}}}
|data={{{data15|}}} |datastyle={{{datastyle|}}} {{{datastyle15|}}}
|class={{{class15|}}} |rowclass={{{rowclass15|}}}
}}{{Infobox/row
|header={{{header16|}}} |headerstyle={{{headerstyle|}}}{{{headerstyle16|}}}
|label={{{label16|}}} |labelstyle={{{labelstyle|}}} {{{labelstyle16|}}}
|data={{{data16|}}} |datastyle={{{datastyle|}}} {{{datastyle16|}}}
|class={{{class16|}}} |rowclass={{{rowclass16|}}}
}}{{Infobox/row
|header={{{header17|}}} |headerstyle={{{headerstyle|}}}{{{headerstyle17|}}}
|label={{{label17|}}} |labelstyle={{{labelstyle|}}} {{{labelstyle17|}}}
|data={{{data17|}}} |datastyle={{{datastyle|}}} {{{datastyle17|}}}
|class={{{class17|}}} |rowclass={{{rowclass17|}}}
}}{{Infobox/row
|header={{{header18|}}} |headerstyle={{{headerstyle|}}}{{{headerstyle18|}}}
|label={{{label18|}}} |labelstyle={{{labelstyle|}}} {{{labelstyle18|}}}
|data={{{data18|}}} |datastyle={{{datastyle|}}} {{{datastyle18|}}}
|class={{{class18|}}} |rowclass={{{rowclass18|}}}
}}{{Infobox/row
|header={{{header19|}}} |headerstyle={{{headerstyle|}}}{{{headerstyle19|}}}
|label={{{label19|}}} |labelstyle={{{labelstyle|}}} {{{labelstyle19|}}}
|data={{{data19|}}} |datastyle={{{datastyle|}}} {{{datastyle19|}}}
|class={{{class19|}}} |rowclass={{{rowclass19|}}}
}}{{Infobox/row
|header={{{header20|}}} |headerstyle={{{headerstyle|}}}{{{headerstyle20|}}}
|label={{{label20|}}} |labelstyle={{{labelstyle|}}} {{{labelstyle20|}}}
|data={{{data20|}}} |datastyle={{{datastyle|}}} {{{datastyle20|}}}
|class={{{class20|}}} |rowclass={{{rowclass20|}}}
}}
</table>

Navigation menu