Difference between revisions of "Template:DM Fusion Material2/for row"

From Yugipedia
Jump to: navigation, search
(fix format value)
(Support for more columns. Necessary for Communication Fusion.)
 
Line 4: Line 4:
 
   <td>{{ #ask: [[Has subobject::{{{1}}}]] |?Reference name= | mainlabel=- | limit = 1 }}</td>
 
   <td>{{ #ask: [[Has subobject::{{{1}}}]] |?Reference name= | mainlabel=- | limit = 1 }}</td>
  
   <!-- The cards this card can fuse with to produce the aforementioned Fusion Monster -->
+
   <!-- The cards this card can fuse with to produce the aforementioned Fusion Monster
  <td><!--
+
    * Double replace is necessary to convert underscores to be spaces
* Store in an array, so we can count the number of cards to determine how many columns to use.
+
    * There can be multiple columns with multiple cards in each
* Double #replace is necessary to replace underscores with spaces.
+
  -->{{ #ask: [[Fuses with::{{ #replace: {{ #replace: {{{1}}} | _ | * * }} | * }}]]
* Change separator from "," to "*" to avoid problems with cards with commas in their name
+
   | ?Fusion Material.Reference name
-->{{ #arraydefine: $fuses_with_cards
+
   | format    = template
| {{ #ask: [[Fuses with::{{ #replace: {{ #replace: {{{1}}} | _ | * * }} | * }}]]
+
   | template  = DM Fusion Material2/for row/cell
   | ?Fusion Material.Reference name=
 
  | class    = compact
 
   | format    = plainlist
 
   | headers  = hide
 
 
   | mainlabel = -
 
   | mainlabel = -
 
   | sep      =  
 
   | sep      =  
Line 20: Line 16:
 
*
 
*
 
   }}
 
   }}
| *
 
}}<!--
 
-->{{ #arrayunique: $fuses_with_cards }}<!--
 
 
-->{{ #vardefine: $column_count
 
| {{ #ifexpr: {{ #arraysize: $fuses_with_cards }} >= 100
 
  | 4
 
  | {{ #ifexpr: {{ #arraysize: $fuses_with_cards }} >= 30
 
    | 3
 
      | {{ #ifexpr: {{ #arraysize: $fuses_with_cards }} >= 20
 
      | 2
 
      }}
 
    }}
 
  }}
 
}}<!--
 
 
-->{{ #if: {{ #var: $column_count }} | <div style="column-width: 13em; column-count: {{ #var: $column_count }};"> }}
 
* {{ #arrayprint: $fuses_with_cards
 
| &#32;
 
*
 
| $fuses_with_card
 
| $fuses_with_card
 
}}
 
{{ #if: {{ #var: $column_count }} | </div> }}
 
</td>
 
 
</tr>
 
</tr>
 
</includeonly>
 
</includeonly>

Latest revision as of 00:17, 26 December 2018