Permanently protected template

Difference between revisions of "Template:OCG-TCG card image"

From Yugipedia
Jump to: navigation, search
(fix)
(prevent the template from vomiting all over everything if it isn't given a card name and can't figure it out from the image name; minor rewording)
Line 37: Line 37:
 
}}{{ #vardefine: $fn_alt      | {{ #explode: {{ #var: $filename }} | - | {{ #var: $count }} }}
 
}}{{ #vardefine: $fn_alt      | {{ #explode: {{ #var: $filename }} | - | {{ #var: $count }} }}
 
}}{{ #vardefine: $fn_name_set | {{ #var: $fn_name_set | {{ #explode: {{ #var: $filename }} | -{{ #var: $fn_rarity | {{ #var: $fn_edition | {{ #var: $fn_release | {{ #var: $fn_alt }} }} }} }} }} }}
 
}}{{ #vardefine: $fn_name_set | {{ #var: $fn_name_set | {{ #explode: {{ #var: $filename }} | -{{ #var: $fn_rarity | {{ #var: $fn_edition | {{ #var: $fn_release | {{ #var: $fn_alt }} }} }} }} }} }}
}}{{ #ifexpr: {{ #len: {{ #explode: {{ #var: $fn_name_set }} | - | -1 }} }} < 6 | {{ #vardefine: $fn_set | {{ #explode: {{ #var: $fn_name_set }} | - | -1 }} }}
+
}}{{ #ifexpr: {{ #len: {{ #explode: {{ #var: $fn_name_set }} | - | -1 }} }} < 5 | {{ #vardefine: $fn_set | {{ #explode: {{ #var: $fn_name_set }} | - | -1 }} }}
 
}}{{ #if: {{ #var: $fn_set }} | {{ #vardefine: $fn_name | {{ #explode: {{ #var: $fn_name_set }} | -{{ #var: $fn_set }} }} }}
 
}}{{ #if: {{ #var: $fn_set }} | {{ #vardefine: $fn_name | {{ #explode: {{ #var: $fn_name_set }} | -{{ #var: $fn_set }} }} }}
  
 
}}{{ #vardefine: $para_name        | {{ #replace: {{{name<noinclude>|Jinzo 7</noinclude>}}} | # }}<!-- original input; should match card's page name including anything in "()" ("#" is allowed/stripped here simply for backwards compatibility, since previously the template required the card's printed name rather than the name of its article) -->
 
}}{{ #vardefine: $para_name        | {{ #replace: {{{name<noinclude>|Jinzo 7</noinclude>}}} | # }}<!-- original input; should match card's page name including anything in "()" ("#" is allowed/stripped here simply for backwards compatibility, since previously the template required the card's printed name rather than the name of its article) -->
}}{{ #vardefine: $para_name        | {{ #var: $para_name | {{ #var: $fn_name }} }}<!-- if no name is given, fall back on the name in the image name (which will fall apart for anything with spaces, etc. in its name, but sometimes we'll luck out and get a single-word name with no punctuation) -->
+
}}{{ #vardefine: $para_name        | {{ #var: $para_name | {{ #var: $fn_name | {{ #var: $fn_name_set }} }} }}<!-- if no name is given, fall back on the name in the image name (which will fall apart for anything with spaces, etc. in its name, but sometimes we'll luck out and get a single-word name with no punctuation); if we couldn't separate the name from the set, just use that since at least then the template output won't be completely borked (the name and set stuff will probably be completely useless in this case, though) -->
 
}}{{ #vardefine: $para_pretty_name  | {{Card name|{{ #var: $para_name }}}}<!-- name as it will be displayed; should include e.g. "#" and exclude "(stuff)" -->
 
}}{{ #vardefine: $para_pretty_name  | {{Card name|{{ #var: $para_name }}}}<!-- name as it will be displayed; should include e.g. "#" and exclude "(stuff)" -->
 
}}{{ #vardefine: $has_article      | {{ #var: $para_pretty_name }}<!-- card has a page -->
 
}}{{ #vardefine: $has_article      | {{ #var: $para_pretty_name }}<!-- card has a page -->
Line 156: Line 156:
 
   }}
 
   }}
 
}}{{imbox
 
}}{{imbox
| text = This is a card image for the {{ #if: {{ #var: $para_rarity_full }} | [[{{ #var: $para_rarity_full }}]] }} {{ #if: {{ #var: $para_edition_full }} | [[{{ #var: $para_edition_full }}]] }} {{ #if: {{ #var: $para_release_full }} | {{ #switch: {{ #var: $para_release }} | Anime | Manga | VG = {{ #var: $para_release_full }} | [[{{ #var: $para_release_full }}]] }} }} card "[[{{ #var: $para_page_name }}|{{ #var: $para_pretty_name }}]]" from the [[Set Card Galleries:{{ #var: $para_pretty_set }} ({{ #var: $para_ocg_tcg }}-{{ #var: $para_region }}{{ #switch: {{ #var: $para_region }} | JP | JA | TC = | #default = {{ #if: {{ #var: $para_edition_abbr }} | -{{ #var: $para_edition_abbr }} | {{ #if: {{ #var: $para_release }} | -1E }} }} }})|{{ #var: $para_region_full }}]] set ''[[{{ #var: $para_set_full }}|{{ #var: $para_pretty_set }}]]''. You can also view a [[Special:Prefixindex/File:{{ #var: $para_url_name }}|list]] {{ #ifeq: {{ #var: $para_url_name }} | {{ #var: $para_old_url_name }} || <span class="cardimageoldname" style="display: none;">([[Special:Prefixindex/File:{{ #var: $para_old_url_name }}|old]])</span> }} {{ #ifexist: Card Gallery:{{ #var: $para_name }} | and [[Card Gallery:{{ #var: $para_name }}|gallery]] }} of all images uploaded for "{{ #var: $para_pretty_name }}".
+
| text = This is a card image for the {{ #if: {{ #var: $para_rarity_full }} | [[{{ #var: $para_rarity_full }}]] }} {{ #if: {{ #var: $para_edition_full }} | [[{{ #var: $para_edition_full }}]] }} {{ #if: {{ #var: $para_release_full }} | {{ #switch: {{ #var: $para_release }} | Anime | Manga | VG = {{ #var: $para_release_full }} | [[{{ #var: $para_release_full }}]] }} }} card "[[{{ #var: $para_page_name }}|{{ #var: $para_pretty_name }}]]" from the [[Set Card Galleries:{{ #var: $para_pretty_set }} ({{ #var: $para_ocg_tcg }}-{{ #var: $para_region }}{{ #switch: {{ #var: $para_region }} | JP | JA | TC = | #default = {{ #if: {{ #var: $para_edition_abbr }} | -{{ #var: $para_edition_abbr }} | {{ #if: {{ #var: $para_release }} | -1E }} }} }})|{{ #var: $para_region_full }}]] print of ''[[{{ #var: $para_set_full }}|{{ #var: $para_pretty_set }}]]''. You can also view a [[Special:Prefixindex/File:{{ #var: $para_url_name }}|list]] {{ #ifeq: {{ #var: $para_url_name }} | {{ #var: $para_old_url_name }} || <span class="cardimageoldname" style="display: none;">([[Special:Prefixindex/File:{{ #var: $para_old_url_name }}|old]])</span> }} {{ #ifexist: Card Gallery:{{ #var: $para_name }} | and [[Card Gallery:{{ #var: $para_name }}|gallery]] }} of all images uploaded for "{{ #var: $para_pretty_name }}".
 
}}
 
}}
 
{{ #ifeq: {{ #var: $ns }} | {{NS:6}} | {{Fair use}} }}<noinclude>{{Documentation}}</noinclude>
 
{{ #ifeq: {{ #var: $ns }} | {{NS:6}} | {{Fair use}} }}<noinclude>{{Documentation}}</noinclude>

Revision as of 13:27, 23 June 2016

  1. Cite error: Invalid <ref> tag; no text was provided for refs named {{{rarity}}}
  2. [[#cite_ref-'"`UNIQ--ref-00000001-QINU`"'_2-0|↑]] Cite error: Invalid <ref> tag; no text was provided for refs named [1]