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

From Yugipedia
Jump to: navigation, search
m (Becasita moved page User:Becasita/SubPages/CardImageUploadTemplate to User:Becasita/SubPages/Templates/CardImage without leaving a redirect: More organized this way.)
(Trying it this way.)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{OCG-TCG card image
+
{{ <includeonly>subst:</includeonly>#vardefine: $FLAG | 0 }}{{OCG-TCG card image
| name    = {{{name|}}}
+
| name    = {{ <includeonly>subst:</includeonly>#if: {{{name|}}} | {{{name}}} | {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | 0 }} }}
| 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|}}}
| region  = {{<includeonly>subst:</includeonly>#vardefineecho:REGION|{{<includeonly>subst:</includeonly>#explode:{{<includeonly>subst:</includeonly>#explode: {{<includeonly>subst:</includeonly>PAGENAME}}|.|0}}|-|2}}}}
+
| {{ <includeonly>subst:</includeonly>#sub: {{ <includeonly>subst:</includeonly>#explode: {{<includeonly>subst:</includeonly>PAGENAME}} | - | 0 }}
{{<includeonly>subst:</includeonly>#switch: {{<includeonly>subst:</includeonly>#explode:{{<includeonly>subst:</includeonly>#explode: {{<includeonly>subst:</includeonly>PAGENAME}}|.|0}}|-|{{<includeonly>subst:</includeonly>#if:{{{alt|}}}|-2|-1}}}}
+
  | {{ <includeonly>subst:</includeonly>#len: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#replace:{{ <includeonly>subst:</includeonly>#replace:{{ <includeonly>subst:</includeonly>#replace:{{ <includeonly>subst:</includeonly>#replace:{{ <includeonly>subst:</includeonly>#replace:{{ <includeonly>subst:</includeonly>#replace:{{ <includeonly>subst:</includeonly>#replace:{{ <includeonly>subst:</includeonly>#replace:{{ <includeonly>subst:</includeonly>#replace:{{ <includeonly>subst:</includeonly>#replace:{{ <includeonly>subst:</includeonly>#replace: {{{name|}}}|:}}|-}}|'}}|,}}|}}|.}}|?}}|#}}|"}}|/}}|\}} | ( }} }}
| OP = {{<includeonly>subst:</includeonly>#switch: {{<includeonly>subst:</includeonly>#var:REGION}}
+
}}{{ <includeonly>subst:</includeonly>#vardefine: $FLAG | 1 }}
        | JP
+
| {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | 1 }} }}{{ <includeonly>subst:</includeonly>#if: {{{post|}}} | -{{{post}}} }}
        | TC = {{<includeonly>subst:</includeonly>!}} release {{<includeonly>subst:</includeonly>=}} {{<includeonly>subst:</includeonly>#explode:{{<includeonly>subst:</includeonly>#explode: {{<includeonly>subst:</includeonly>PAGENAME}}|.|0}}|-|3}}
+
| 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 }} }} }} }}
        | #default = {{<includeonly>subst:</includeonly>!}} edition {{<includeonly>subst:</includeonly>=}} {{<includeonly>subst:</includeonly>#explode:{{<includeonly>subst:</includeonly>#explode: {{<includeonly>subst:</includeonly>PAGENAME}}|.|0}}|-|3}}
+
{{ <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>!}} release {{<includeonly>subst:</includeonly>=}} {{<includeonly>subst:</includeonly>#explode:{{<includeonly>subst:</includeonly>#explode: {{<includeonly>subst:</includeonly>PAGENAME}}|.|0}}|-|{{<includeonly>subst:</includeonly>#if:{{{alt|}}}|-2|-1}}}}
+
  | OP = {{ <includeonly>subst:</includeonly>#switch: {{ <includeonly>subst:</includeonly>#var:$REGION }}
        }}
+
            | JP
| CT
+
            | JA
| GC = {{<includeonly>subst:</includeonly>#switch: {{<includeonly>subst:</includeonly>#var:REGION}}
+
            | 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 }} }} }}
        | JP
+
            | #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 }} }} }}
        | TC = {{<includeonly>subst:</includeonly>!}} rarity  {{<includeonly>subst:</includeonly>=}} {{<includeonly>subst:</includeonly>#explode:{{<includeonly>subst:</includeonly>#explode: {{<includeonly>subst:</includeonly>PAGENAME}}|.|0}}|-|3}}
+
{{ <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>#if:{{{alt|}}}|-2|-1}}}}
+
          }}
        | #default = {{<includeonly>subst:</includeonly>!}} rarity  {{<includeonly>subst:</includeonly>=}} {{<includeonly>subst:</includeonly>#explode:{{<includeonly>subst:</includeonly>#explode: {{<includeonly>subst:</includeonly>PAGENAME}}|.|0}}|-|3}}
+
  | RP
{{<includeonly>subst:</includeonly>!}} edition {{<includeonly>subst:</includeonly>=}} {{<includeonly>subst:</includeonly>#explode:{{<includeonly>subst:</includeonly>#explode: {{<includeonly>subst:</includeonly>PAGENAME}}|.|0}}|-|4}}
+
  | CT
{{<includeonly>subst:</includeonly>!}} release {{<includeonly>subst:</includeonly>=}} {{<includeonly>subst:</includeonly>#explode:{{<includeonly>subst:</includeonly>#explode: {{<includeonly>subst:</includeonly>PAGENAME}}|.|0}}|-|{{<includeonly>subst:</includeonly>#if:{{{alt|}}}|-2|-1}}}}
+
  | GC = {{ <includeonly>subst:</includeonly>#switch: {{ <includeonly>subst:</includeonly>#var: $REGION }}
        }}
+
            | JP
| #default = {{<includeonly>subst:</includeonly>!}} rarity  {{<includeonly>subst:</includeonly>=}} {{<includeonly>subst:</includeonly>#explode:{{<includeonly>subst:</includeonly>#explode: {{<includeonly>subst:</includeonly>PAGENAME}}|.|0}}|-|3}}
+
            | JA
{{<includeonly>subst:</includeonly>#switch: {{<includeonly>subst:</includeonly>#var:REGION}}
+
            | 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 }} }} }}
  | JP
+
{{ <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 }} }}
  | TC = {{<includeonly>subst:</includeonly>#ifeq:{{<includeonly>subst:</includeonly>#explode:{{<includeonly>subst:</includeonly>#explode: {{<includeonly>subst:</includeonly>PAGENAME}}|.|0}}|-|{{<includeonly>subst:</includeonly>#if:{{{alt|}}}|-2|-1}}}} | DT | {{<includeonly>subst:</includeonly>!}} edition = {{<includeonly>subst:</includeonly>#explode:{{<includeonly>subst:</includeonly>#explode: {{<includeonly>subst:</includeonly>PAGENAME}}|.|0}}|-|{{<includeonly>subst:</includeonly>#if:{{{alt|}}}|-2|-1}}}} | }}
+
            | #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 }} }} }}
  | #default = {{<includeonly>subst:</includeonly>!}} edition = {{<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 }} }}
 +
          }}
 +
  | #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 }}
 +
  | JP
 +
  | JA
 +
  | 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 }} | - | {{ <includeonly>subst:</includeonly>#expr:  4 - {{ <includeonly>subst:</includeonly>#var: $FLAG }} }} }}
 
  }}
 
  }}
}}
+
}}
{{<includeonly>subst:</includeonly>#if:{{{alt|}}}|{{<includeonly>subst:</includeonly>!}} alt    = {{<includeonly>subst:</includeonly>#explode:{{<includeonly>subst:</includeonly>#explode: {{<includeonly>subst:</includeonly>PAGENAME}}|.|0}}|-|-1}}
+
{{ <includeonly>subst:</includeonly>#if: {{{alt|}}} | {{ <includeonly>subst:</includeonly>! }} alt    = {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>#explode: {{ <includeonly>subst:</includeonly>PAGENAME }} | . | 0 }} | - | -1 }}
{{<includeonly>subst:</includeonly>))}}|{{<includeonly>subst:</includeonly>))}}}}<noinclude>
+
{{ <includeonly>subst:</includeonly>)) }} | {{ <includeonly>subst:</includeonly>)) }} }}<noinclude>
 
<br style = "clear:both;" />
 
<br style = "clear:both;" />
 
__NOTOC__
 
__NOTOC__
 
==Description==
 
==Description==
 
Based on the {{t|OCG-TCG card image}} template.<br />
 
Based on the {{t|OCG-TCG card image}} template.<br />
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), [[Replica]]s (RP) 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===
 
* Badly designed.
 
  
 
==Usage==
 
==Usage==
 
<pre>
 
<pre>
{{subst::User:Becasita/SubPages/CardImageUploadTemplate
+
{{subst::User:Becasita/SubPages/Templates/CardImage
 
| name =  
 
| name =  
 +
| fix  =
 
| post =  
 
| post =  
 
| alt  =  
 
| alt  =  
Line 49: Line 56:
  
 
; <code>name</code>
 
; <code>name</code>
: The English name of the card.
+
: The English name of the card. If a card only as one word as its name and that word doesn't contain non-alphabetical characters (e.g., <code>!</code>, <code>#</code>, etc.), this parameter could be left blank.
 +
; <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 <code>1</code>. If this parameter is used, the <code>name</code> must be used.
 
; <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 or removed if the set does not need a postfix.
 
; <code>alt</code>
 
; <code>alt</code>
: To be filled with <code>1</code> if the card requires the <code>alt</code> parameter. Should be left at blank otherwise.
+
: To be filled with <code>1</code> if the card requires the <code>alt</code> parameter. Should be left at blank or removed otherwise.
  
 
===Example===
 
===Example===
'''''In standby.'''''<br />
+
For a card like [[:File:Number39Utopia-YS11-EN-UE-OP.png]], it should be:
For a card like  
+
<pre>
 +
{{subst::User:Becasita/SubPages/Templates/CardImage
 +
| name = Number 39: Utopia
 +
| fix  =
 +
| post =
 +
| alt  =
 +
}}
 +
</pre>
 +
----
 +
For a card like [[:File:TempestMagician-SOVR-FR-SR-LE.png]], it should be:
 +
<pre>
 +
{{subst::User:Becasita/SubPages/Templates/CardImage
 +
| name = Tempest Magician
 +
| fix  =
 +
| post = SE
 +
| alt  =
 +
}}
 +
</pre>
 +
----
 +
For a card like [[:File:GraphaDragonLordofDarkWorld-DL18-SP-R-UE-Purple.png]], it should be:
 +
<pre>
 +
{{subst::User:Becasita/SubPages/Templates/CardImage
 +
| name = Grapha, Dragon Lord of Dark World
 +
| fix  =
 +
| post =
 +
| alt  = 1
 +
}}
 +
</pre>
 +
 
 +
==Draft==
 
<pre>
 
<pre>
{{subst::User:Becasita/SubPages/CardImageUploadTemplate|<Card name>}}
+
{{subst:#if:{{{watermark|}}}|{{Watermark}}
 +
|}}{{subst:#if:{{{poor quality|}}}|{{Poor quality}}
 +
|}}
 
</pre>
 
</pre>
 
</noinclude>
 
</noinclude>

Latest revision as of 17:35, 9 May 2016

{{OCG-TCG card image | name = Becasita/SubPages/Templates/CardImage | set = | region = | rarity = | edition = }}

Description[edit]

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), Replicas (RP) 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.

Usage[edit]

{{subst::User:Becasita/SubPages/Templates/CardImage
| name = 
| fix  = 
| post = 
| alt  = 
}}
name
The English name of the card. If a card only as one word as its name and that word doesn't contain non-alphabetical characters (e.g., !, #, etc.), this parameter could be left blank.
fix
In case the image name is obsolete (named accordingly to the old Yu-Gi-Oh!:Image Policy), this parameter should be filled with 1. If this parameter is used, the name must be used.
post
The postfix of a set. Should be left blank or removed 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 or removed otherwise.

Example[edit]

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[edit]

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