Difference between revisions of "User:Becasita/SubPages/Templates/Card/Sortkey"

From Yugipedia
< User:Becasita‎ | SubPages‎ | Templates‎ | Card
Jump to: navigation, search
(Creating. This is used to define a sortkey for OCG/TCG cards.)
 
(Simpler and more correct.)
 
Line 13: Line 13:
  
 
# Check for "A"/"An"/"The":
 
# Check for "A"/"An"/"The":
-->{{ #if: {{ #pos: {{ #var: $Input-0 }} | A   }}<!--
+
-->{{ #switch: {{ #var: $Input-0 }}
        -->{{ #pos: {{ #var: $Input-0 }} | An }}<!--
+
      | A | An
        -->{{ #pos: {{ #var: $Input-0 }} | The }}
+
      | The = {{ #if: {{ #pos: {{ #var: $Input }} | The Agent }}<!--
      | {{ #if: {{ #pos: {{ #var: $Input }} | The Agent }}<!--
+
                  -->{{ #pos: {{ #var: $Input }} | The Fabled }}
            -->{{ #pos: {{ #var: $Input }} | The Fabled }}
+
                | <!-- Nothing for "The Agent" and "The Fabled". -->
          | <!-- Nothing for "The Agent" and "The Fabled". -->
+
                | {{ #vardefine: $Sortkey
          | {{ #vardefine: $Sortkey
+
                      | {{ #sub: {{ #var: $Input }} | {{ #len: {{ #var: $Input-0 }} }} }}
                | {{ #sub: {{ #var: $Input }} | {{ #len: {{ #var: $Input-0 }} }} }}
+
                  }}
            }}
+
              }}
        }}
 
 
   }}<!--
 
   }}<!--
  
Line 48: Line 47:
  
 
# Else:
 
# Else:
-->{{ #if: {{ #var: $Sortkey }}
+
-->{{ #vardefine: $Sortkey
      | <!-- There already is a sortkey. -->
+
       | {{ #var: $Sortkey
       | {{ #vardefine: $Sortkey | {{ #var: $Input }} }}
+
          | {{ #var: $Input }}
 +
        }}
 
   }}<!--
 
   }}<!--
  

Latest revision as of 22:56, 3 April 2017

  • $Input-0:
  • $Input-1:
  • $Input-S1:
  • $Input-Number:
  • $Input-Number-Name:
  • Sortkey: