Difference between revisions of "User:Becasita/SubPages/Templates/CardImage"

From Yugipedia
Jump to: navigation, search
m (Trying to make this more legible.)
(Trying to make this versatile enough to deal with pics named by the old Yu-Gi-Oh!:Image policy.)
Line 1: Line 1:
{{OCG-TCG card image
+
{{ <includeonly>subst:</includeonly>#vardefine: $FLAG | 0 }}{{OCG-TCG card image
 
| name    = {{{name|}}}
 
| name    = {{{name|}}}
| set    = {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | 1 }}{{ <includeonly>subst:</includeonly>#if: {{{post|}}} | -{{{post}}} }}
+
| set    = {{ <includeonly>subst:</includeonly>#if: {{{fix|}}} | {{{fix|}}} {{ <includeonly>subst:</includeonly>#vardefine: $FLAG | 1 }} | {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | 1 }} }}{{ <includeonly>subst:</includeonly>#if: {{{post|}}} | -{{{post}}} }}
| region  = {{ <includeonly>subst:</includeonly>#vardefineecho:$REGION | {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | 2 }} }}
+
| region  = {{ <includeonly>subst:</includeonly>#vardefineecho:$REGION | {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#expr:  2 - {{ <includeonly>subst:</includeonly>#var: $FLAG }} }} }} }}
 
{{ <includeonly>subst:</includeonly>#switch: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#vardefineecho:$LAST | {{ <includeonly>subst:</includeonly>#if: {{{alt|}}} | -2 | -1 }} }} }}
 
{{ <includeonly>subst:</includeonly>#switch: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#vardefineecho:$LAST | {{ <includeonly>subst:</includeonly>#if: {{{alt|}}} | -2 | -1 }} }} }}
 
   | OP = {{ <includeonly>subst:</includeonly>#switch: {{ <includeonly>subst:</includeonly>#var:$REGION }}
 
   | OP = {{ <includeonly>subst:</includeonly>#switch: {{ <includeonly>subst:</includeonly>#var:$REGION }}
 
             | JP  
 
             | JP  
             | TC = {{ <includeonly>subst:</includeonly>! }} release {{ <includeonly>subst:</includeonly>= }} {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | 3 }}
+
             | TC = {{ <includeonly>subst:</includeonly>! }} release {{ <includeonly>subst:</includeonly>= }} {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#expr:  3 - {{ <includeonly>subst:</includeonly>#var: $FLAG }} }} }}
             | #default = {{ <includeonly>subst:</includeonly>! }} edition {{ <includeonly>subst:</includeonly>= }} {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | 3 }}
+
             | #default = {{ <includeonly>subst:</includeonly>! }} edition {{ <includeonly>subst:</includeonly>= }} {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#expr:  3 - {{ <includeonly>subst:</includeonly>#var: $FLAG }} }} }}
 
{{ <includeonly>subst:</includeonly>! }} release {{ <includeonly>subst:</includeonly>= }} {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#var: $LAST }} }}
 
{{ <includeonly>subst:</includeonly>! }} release {{ <includeonly>subst:</includeonly>= }} {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#var: $LAST }} }}
 
           }}
 
           }}
Line 13: Line 13:
 
   | GC = {{ <includeonly>subst:</includeonly>#switch: {{ <includeonly>subst:</includeonly>#var: $REGION }}
 
   | GC = {{ <includeonly>subst:</includeonly>#switch: {{ <includeonly>subst:</includeonly>#var: $REGION }}
 
             | JP  
 
             | JP  
             | TC = {{ <includeonly>subst:</includeonly>! }} rarity  {{ <includeonly>subst:</includeonly>= }} {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | 3 }}
+
             | TC = {{ <includeonly>subst:</includeonly>! }} rarity  {{ <includeonly>subst:</includeonly>= }} {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#expr:  3 - {{ <includeonly>subst:</includeonly>#var: $FLAG }} }} }}
 
{{ <includeonly>subst:</includeonly>! }} release {{ <includeonly>subst:</includeonly>= }} {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#var: $LAST }} }}
 
{{ <includeonly>subst:</includeonly>! }} release {{ <includeonly>subst:</includeonly>= }} {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#var: $LAST }} }}
             | #default = {{ <includeonly>subst:</includeonly>! }} rarity  {{ <includeonly>subst:</includeonly>= }} {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | 3 }}
+
             | #default = {{ <includeonly>subst:</includeonly>! }} rarity  {{ <includeonly>subst:</includeonly>= }} {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#expr:  3 - {{ <includeonly>subst:</includeonly>#var: $FLAG }} }} }}
{{ <includeonly>subst:</includeonly>! }} edition {{ <includeonly>subst:</includeonly>= }} {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | 4 }}
+
{{ <includeonly>subst:</includeonly>! }} edition {{ <includeonly>subst:</includeonly>= }} {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#expr:  4 - {{ <includeonly>subst:</includeonly>#var: $FLAG }} }} }}
 
{{ <includeonly>subst:</includeonly>! }} release {{ <includeonly>subst:</includeonly>= }} {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#var: $LAST }} }}
 
{{ <includeonly>subst:</includeonly>! }} release {{ <includeonly>subst:</includeonly>= }} {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#var: $LAST }} }}
 
           }}
 
           }}
   | #default = {{ <includeonly>subst:</includeonly>! }} rarity  {{ <includeonly>subst:</includeonly>= }} {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | 3 }}
+
   | #default = {{ <includeonly>subst:</includeonly>! }} rarity  {{ <includeonly>subst:</includeonly>= }} {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#expr:  3 - {{ <includeonly>subst:</includeonly>#var: $FLAG }} }} }}
 
{{ <includeonly>subst:</includeonly>#switch: {{ <includeonly>subst:</includeonly>#var: $REGION }}
 
{{ <includeonly>subst:</includeonly>#switch: {{ <includeonly>subst:</includeonly>#var: $REGION }}
 
   | JP
 
   | JP
 
   | TC = {{ <includeonly>subst:</includeonly>#ifeq: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#var: $LAST }} }} | DT | {{ <includeonly>subst:</includeonly>! }} edition = {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#var: $LAST }} }} }}
 
   | TC = {{ <includeonly>subst:</includeonly>#ifeq: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#var: $LAST }} }} | DT | {{ <includeonly>subst:</includeonly>! }} edition = {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#var: $LAST }} }} }}
   | #default = {{ <includeonly>subst:</includeonly>! }} edition = {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | 4 }}
+
   | #default = {{ <includeonly>subst:</includeonly>! }} edition = {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | {{ <includeonly>subst:</includeonly>#expr:  4 - {{ <includeonly>subst:</includeonly>#var: $FLAG }} }} }}
 
  }}
 
  }}
 
  }}
 
  }}
Line 34: Line 34:
 
Made to help with card image upload. It fills the parameters required automatically. Works with [[TCG]] and [[OCG]] cards (including [[Official Proxy|Proxies]] (OP), [[Giant Card]]s (GC), [[Case Topper]]s (CT) and [[Duel Terminal]] (DT) cards).
 
Made to help with card image upload. It fills the parameters required automatically. Works with [[TCG]] and [[OCG]] cards (including [[Official Proxy|Proxies]] (OP), [[Giant Card]]s (GC), [[Case Topper]]s (CT) and [[Duel Terminal]] (DT) cards).
  
<span style = "color:Red;">'''Attention:'''</span> The output depends on the name of the file! So it's advisable to apply it only on files named accordingly to the [[Yu-Gi-Oh!:Image Policy]]!
+
<span style = "color:Red;">'''Attention:'''</span> The output depends on the name of the file! So it's advisable to apply it only on files named accordingly to the [[Yu-Gi-Oh!:Image Policy]]!<br />
 +
If using on pics named accordingly to the old Yu-Gi-Oh!:Image Policy, the <code>fix</code> parameter should be used.
  
 
===Known Problems===
 
===Known Problems===
Line 43: Line 44:
 
{{subst::User:Becasita/SubPages/Templates/CardImage
 
{{subst::User:Becasita/SubPages/Templates/CardImage
 
| name =  
 
| name =  
 +
| fix  =
 
| post =  
 
| post =  
 
| alt  =  
 
| alt  =  
Line 50: Line 52:
 
; <code>name</code>
 
; <code>name</code>
 
: The English name of the card.
 
: The English name of the card.
 +
; <code>fix</code>
 +
: In case the image name is obsolete (named accordingly to the old Yu-Gi-Oh!:Image Policy), this parameter should be filled with the set name.
 
; <code>post</code>
 
; <code>post</code>
 
: The postfix of a set. Should be left blank if the set does not need a postfix.
 
: The postfix of a set. Should be left blank if the set does not need a postfix.
Line 60: Line 64:
 
{{subst::User:Becasita/SubPages/Templates/CardImage
 
{{subst::User:Becasita/SubPages/Templates/CardImage
 
| name = Number 39: Utopia
 
| name = Number 39: Utopia
 +
| fix  =
 
| post =  
 
| post =  
 
| alt  =  
 
| alt  =  
Line 69: Line 74:
 
{{subst::User:Becasita/SubPages/Templates/CardImage
 
{{subst::User:Becasita/SubPages/Templates/CardImage
 
| name = Tempest Magician
 
| name = Tempest Magician
 +
| fix  =
 
| post = SE
 
| post = SE
 
| alt  =  
 
| alt  =  
Line 78: Line 84:
 
{{subst::User:Becasita/SubPages/Templates/CardImage
 
{{subst::User:Becasita/SubPages/Templates/CardImage
 
| name = Grapha, Dragon Lord of Dark World
 
| name = Grapha, Dragon Lord of Dark World
 +
| fix  =
 
| post =  
 
| post =  
 
| alt  = 1
 
| alt  = 1

Revision as of 20:39, 21 April 2016

{{OCG-TCG card image | name = | set = | region = | rarity = | edition = }}

Description

Based on the {{OCG-TCG card image}} template.
Made to help with card image upload. It fills the parameters required automatically. Works with TCG and OCG cards (including Proxies (OP), Giant Cards (GC), Case Toppers (CT) and Duel Terminal (DT) cards).

Attention: The output depends on the name of the file! So it's advisable to apply it only on files named accordingly to the Yu-Gi-Oh!:Image Policy!
If using on pics named accordingly to the old Yu-Gi-Oh!:Image Policy, the fix parameter should be used.

Known Problems

  • Badly designed.

Usage

{{subst::User:Becasita/SubPages/Templates/CardImage
| name = 
| fix  = 
| post = 
| alt  = 
}}
name
The English name of the card.
fix
In case the image name is obsolete (named accordingly to the old Yu-Gi-Oh!:Image Policy), this parameter should be filled with the set name.
post
The postfix of a set. Should be left blank if the set does not need a postfix.
alt
To be filled with 1 if the card requires the alt parameter. Should be left at blank otherwise.

Example

For a card like File:Number39Utopia-YS11-EN-UE-OP.png, it should be:

{{subst::User:Becasita/SubPages/Templates/CardImage
| name = Number 39: Utopia
| fix  = 
| post = 
| alt  = 
}}

For a card like File:TempestMagician-SOVR-FR-SR-LE.png, it should be:

{{subst::User:Becasita/SubPages/Templates/CardImage
| name = Tempest Magician
| fix  = 
| post = SE
| alt  = 
}}

For a card like File:GraphaDragonLordofDarkWorld-DL18-SP-R-UE-Purple.png, it should be:

{{subst::User:Becasita/SubPages/Templates/CardImage
| name = Grapha, Dragon Lord of Dark World
| fix  = 
| post = 
| alt  = 1
}}

Draft

{{subst:#if:{{{watermark|}}}|{{Watermark}}
|}}{{subst:#if:{{{poor quality|}}}|{{Poor quality}}
|}}