Difference between revisions of "Template:Shops/TableRow"

From MHWiki
m (Removed unnecessary space)
m (Added "other" parameters for specific transclusion flexibility, changed "vAlignCenter" parameter to "RowvAlignCenter" to more consistently reflect parameter attribute)
Line 13: Line 13:
 
There are mandatory parameters for this template which '''must''' be used when inserting it:
 
There are mandatory parameters for this template which '''must''' be used when inserting it:
 
  <nowiki>{{Shops/TableRow
 
  <nowiki>{{Shops/TableRow
  | ItemData             = Defaults to ""      if left blank            , otherwise as per editor input  
+
  | ItemData             = Defaults to ""      if left blank            , otherwise as per editor input  
  | CostData             = Defaults to ""      if left blank            , otherwise as per editor input  
+
  | CostData             = Defaults to ""      if left blank            , otherwise as per editor input  
  | RequirementData     = Defaults to ""      if left blank            , otherwise as per editor input  
+
  | RequirementData       = Defaults to ""      if left blank            , otherwise as per editor input  
  | RefundData           = Defaults to ""      if left blank            , otherwise as per editor input  
+
  | RefundData           = Defaults to ""      if left blank            , otherwise as per editor input  
 
}}</nowiki>
 
}}</nowiki>
 
The various '''<code><nowiki>***Data</nowiki></code>''' parameters determine the cell content in the row.
 
The various '''<code><nowiki>***Data</nowiki></code>''' parameters determine the cell content in the row.
Line 22: Line 22:
 
The following parameters '''will''' get used when wanting a 5-column row (the default is a 4-column row):
 
The following parameters '''will''' get used when wanting a 5-column row (the default is a 4-column row):
 
  <nowiki>{{Shops/TableRow
 
  <nowiki>{{Shops/TableRow
  | NoteColumn           = Defaults to ""      if left blank (no column), otherwise input "Yes" for the Note column to appear
+
  | NoteColumn           = Defaults to ""      if left blank (no column), otherwise input "Yes" for the Note column to appear
  | NoteData             = Defaults to ""      if left blank            , otherwise as per editor input  
+
  | NoteData             = Defaults to ""      if left blank            , otherwise as per editor input  
 
}}</nowiki>
 
}}</nowiki>
 
The '''<code><nowiki>NoteColumn</nowiki></code>''' parameter is the toggle used for adding the 5th column. Note that the input '''must''' be '''Yes''', not yes or anything else.<br>
 
The '''<code><nowiki>NoteColumn</nowiki></code>''' parameter is the toggle used for adding the 5th column. Note that the input '''must''' be '''Yes''', not yes or anything else.<br>
Line 30: Line 30:
 
Optional parameters for this template include:
 
Optional parameters for this template include:
 
  <nowiki>{{ShopsTableRow
 
  <nowiki>{{ShopsTableRow
  | vAlignCenter        = Defaults to "top"    if left blank            , otherwise input "Yes" for "center"
+
  | RowvAlignCenter      = Defaults to "top"    if left blank            , otherwise input "Yes" for "center"
  | ItemAlignCenter     = Defaults to "left"  if left blank            , otherwise input "Yes" for "center"
+
| RowOtherStyle        = Defaults to ""      if left blank            , otherwise as per editor input
  | NoteAlignLeft       = Defaults to "center" if left blank            , otherwise input "Yes" for "left"
+
| RowOtherClass        = Defaults to ""      if left blank            , otherwise as per editor input
  | CostAlignLeft       = Defaults to "center" if left blank            , otherwise input "Yes" for "left"
+
| RowOtherHTML          = Defaults to ""      if left blank            , otherwise as per editor input
  | RequirementAlignLeft = Defaults to "center" if left blank            , otherwise input "Yes" for "left"
+
  | ItemAlignCenter       = Defaults to "left"  if left blank            , otherwise input "Yes" for "center"
  | RefundAlignLeft     = Defaults to "center" if left blank            , otherwise input "Yes" for "left"
+
| ItemOtherStyle        = Defaults to ""      if left blank            , otherwise as per editor input
 +
| ItemOtherClass        = Defaults to ""      if left blank            , otherwise as per editor input
 +
| ItemOtherHTML        = Defaults to ""      if left blank            , otherwise as per editor input
 +
  | NoteAlignLeft         = Defaults to "center" if left blank            , otherwise input "Yes" for "left"
 +
| NoteOtherStyle        = Defaults to ""      if left blank            , otherwise as per editor input
 +
| NoteOtherClass        = Defaults to ""      if left blank            , otherwise as per editor input
 +
| NoteOtherHTML        = Defaults to ""      if left blank            , otherwise as per editor input
 +
  | CostAlignLeft         = Defaults to "center" if left blank            , otherwise input "Yes" for "left"
 +
| CostOtherStyle        = Defaults to ""      if left blank            , otherwise as per editor input
 +
| CostOtherClass        = Defaults to ""      if left blank            , otherwise as per editor input
 +
| CostOtherHTML        = Defaults to ""      if left blank            , otherwise as per editor input
 +
  | RequirementAlignLeft = Defaults to "center" if left blank            , otherwise input "Yes" for "left"
 +
| RequirementOtherStyle = Defaults to ""      if left blank            , otherwise as per editor input
 +
| RequirementOtherClass = Defaults to ""      if left blank            , otherwise as per editor input
 +
| RequirementOtherHTML  = Defaults to ""      if left blank            , otherwise as per editor input
 +
  | RefundAlignLeft       = Defaults to "center" if left blank            , otherwise input "Yes" for "left"
 +
| RefundOtherStyle      = Defaults to ""      if left blank            , otherwise as per editor input
 +
| RefundOtherClass      = Defaults to ""      if left blank            , otherwise as per editor input
 +
| RefundOtherHTML      = Defaults to ""      if left blank            , otherwise as per editor input
 
}}</nowiki>
 
}}</nowiki>
 
Should any of them be used very often, it may suggest that a revision to the base template is needed. Please submit a proposal to the other editors and decide if this change should be made.<br>
 
Should any of them be used very often, it may suggest that a revision to the base template is needed. Please submit a proposal to the other editors and decide if this change should be made.<br>
Line 41: Line 59:
 
----
 
----
 
For easy reference, the code transcluded by the template is:
 
For easy reference, the code transcluded by the template is:
  <nowiki>  <tr style="vertical-align: {{ifeq|{{{vAlignCenter|}}}|Yes|center|top}}">
+
  <nowiki>  <tr style="vertical-align: {{ifeq|{{{RowvAlignCenter|}}}|Yes|center|top}}; {{{RowOtherStyle|}}}" class="{{{RowOtherClass|}}}" {{{RowOtherHTML|}}}>
     <td style="text-align: {{ifeq|{{{ItemAlignCenter|}}}|Yes|center|left}}">{{{ItemData|}}}</td>
+
     <td style="text-align: {{ifeq|{{{ItemAlignCenter|}}}|Yes|center|left}}; {{{ItemOtherStyle|}}}" class="{{{ItemOtherClass|}}}" {{{ItemOtherHTML|}}}>{{{ItemData|}}}</td>
     {{ifeq|1={{{NoteColumn|}}}|2=Yes|3=<td style="text-align: {{ifeq|{{{NoteAlignLeft|}}}|Yes|left|center}}">{{{NoteData|}}}</td>|4=}}
+
     {{ifeq|1={{{NoteColumn|}}}|2=Yes|3=<td style="text-align: {{ifeq|{{{NoteAlignLeft|}}}|Yes|left|center}}; {{{NoteOtherStyle|}}}" class="{{{NoteOtherClass|}}}" {{{NoteOtherHTML|}}}>{{{NoteData|}}}</td>|4=}}
     <td style="text-align: {{ifeq|{{{CostAlignLeft|}}}|Yes|left|center}}">{{{CostData|}}}</td>
+
     <td style="text-align: {{ifeq|{{{CostAlignLeft|}}}|Yes|left|center}}; {{{CostOtherStyle|}}}" class="{{{CostOtherClass|}}}" {{{CostOtherHTML|}}}>{{{CostData|}}}</td>
     <td style="text-align: {{ifeq|{{{RequirementAlignLeft|}}}|Yes|left|center}}">{{{RequirementData|}}}</td>
+
     <td style="text-align: {{ifeq|{{{RequirementAlignLeft|}}}|Yes|left|center}}; {{{RequirementOtherStyle|}}}" class="{{{RequirementOtherClass|}}}" {{{RequirementOtherHTML|}}}>{{{RequirementData|}}}</td>
     <td style="text-align: {{ifeq|{{{RefundAlignLeft|}}}|Yes|left|center}}">{{{RefundData|}}}</td>
+
     <td style="text-align: {{ifeq|{{{RefundAlignLeft|}}}|Yes|left|center}}; {{{RefundOtherStyle|}}}" class="{{{RefundOtherClass|}}}" {{{RefundOtherHTML|}}}>{{{RefundData|}}}</td>
   </tr></nowiki></noinclude><includeonly>  <tr style="vertical-align: {{ifeq|{{{vAlignCenter|}}}|Yes|center|top}}">
+
   </tr></nowiki></noinclude><includeonly>  <tr style="vertical-align: {{ifeq|{{{RowvAlignCenter|}}}|Yes|center|top}}; {{{RowOtherStyle|}}}" class="{{{RowOtherClass|}}}" {{{RowOtherHTML|}}}>
     <td style="text-align: {{ifeq|{{{ItemAlignCenter|}}}|Yes|center|left}}">{{{ItemData|}}}</td>
+
     <td style="text-align: {{ifeq|{{{ItemAlignCenter|}}}|Yes|center|left}}; {{{ItemOtherStyle|}}}" class="{{{ItemOtherClass|}}}" {{{ItemOtherHTML|}}}>{{{ItemData|}}}</td>
     {{ifeq|1={{{NoteColumn|}}}|2=Yes|3=<td style="text-align: {{ifeq|{{{NoteAlignLeft|}}}|Yes|left|center}}">{{{NoteData|}}}</td>|4=}}
+
     {{ifeq|1={{{NoteColumn|}}}|2=Yes|3=<td style="text-align: {{ifeq|{{{NoteAlignLeft|}}}|Yes|left|center}}; {{{NoteOtherStyle|}}}" class="{{{NoteOtherClass|}}}" {{{NoteOtherHTML|}}}>{{{NoteData|}}}</td>|4=}}
     <td style="text-align: {{ifeq|{{{CostAlignLeft|}}}|Yes|left|center}}">{{{CostData|}}}</td>
+
     <td style="text-align: {{ifeq|{{{CostAlignLeft|}}}|Yes|left|center}}; {{{CostOtherStyle|}}}" class="{{{CostOtherClass|}}}" {{{CostOtherHTML|}}}>{{{CostData|}}}</td>
     <td style="text-align: {{ifeq|{{{RequirementAlignLeft|}}}|Yes|left|center}}">{{{RequirementData|}}}</td>
+
     <td style="text-align: {{ifeq|{{{RequirementAlignLeft|}}}|Yes|left|center}}; {{{RequirementOtherStyle|}}}" class="{{{RequirementOtherClass|}}}" {{{RequirementOtherHTML|}}}>{{{RequirementData|}}}</td>
     <td style="text-align: {{ifeq|{{{RefundAlignLeft|}}}|Yes|left|center}}">{{{RefundData|}}}</td>
+
     <td style="text-align: {{ifeq|{{{RefundAlignLeft|}}}|Yes|left|center}}; {{{RefundOtherStyle|}}}" class="{{{RefundOtherClass|}}}" {{{RefundOtherHTML|}}}>{{{RefundData|}}}</td>
 
   </tr></includeonly>
 
   </tr></includeonly>

Revision as of 23:15, 25 March 2022

In order to use this template, insert {{Shops/TableRow}}, with the mandatory parameters stated below.
Please note that sole usage of this {{Shops/TableRow}} template is not sufficient for generating a full table.
This template itself is not used directly: instead, {{Shops/TableRow/XXX}} templates where XXX represents a shop item are created using this template, with those then being used directly.
{{Shops/TableRow/XXX}} templates must be placed after the {{Shops/TableHeader}} template.
{{Shops/TableRow/XXX}} templates must be placed before a </table> tag (NOT |}!).

A mockup of a full table is shown below:
{{Shops/TableHeader}}
{{Shops/TableRow/ABC}}
{{Shops/TableRow/XYZ}}
</table>


There are mandatory parameters for this template which must be used when inserting it:

{{Shops/TableRow
 | ItemData              = Defaults to ""       if left blank            , otherwise as per editor input 
 | CostData              = Defaults to ""       if left blank            , otherwise as per editor input 
 | RequirementData       = Defaults to ""       if left blank            , otherwise as per editor input 
 | RefundData            = Defaults to ""       if left blank            , otherwise as per editor input 
}}

The various ***Data parameters determine the cell content in the row.


The following parameters will get used when wanting a 5-column row (the default is a 4-column row):

{{Shops/TableRow
 | NoteColumn            = Defaults to ""       if left blank (no column), otherwise input "Yes" for the Note column to appear
 | NoteData              = Defaults to ""       if left blank            , otherwise as per editor input 
}}

The NoteColumn parameter is the toggle used for adding the 5th column. Note that the input must be Yes, not yes or anything else.
The NoteData parameter determines the cell content in the 5th column.


Optional parameters for this template include:

{{ShopsTableRow
 | RowvAlignCenter       = Defaults to "top"    if left blank            , otherwise input "Yes" for "center"
 | RowOtherStyle         = Defaults to ""       if left blank            , otherwise as per editor input
 | RowOtherClass         = Defaults to ""       if left blank            , otherwise as per editor input
 | RowOtherHTML          = Defaults to ""       if left blank            , otherwise as per editor input
 | ItemAlignCenter       = Defaults to "left"   if left blank            , otherwise input "Yes" for "center"
 | ItemOtherStyle        = Defaults to ""       if left blank            , otherwise as per editor input
 | ItemOtherClass        = Defaults to ""       if left blank            , otherwise as per editor input
 | ItemOtherHTML         = Defaults to ""       if left blank            , otherwise as per editor input
 | NoteAlignLeft         = Defaults to "center" if left blank            , otherwise input "Yes" for "left"
 | NoteOtherStyle        = Defaults to ""       if left blank            , otherwise as per editor input
 | NoteOtherClass        = Defaults to ""       if left blank            , otherwise as per editor input
 | NoteOtherHTML         = Defaults to ""       if left blank            , otherwise as per editor input
 | CostAlignLeft         = Defaults to "center" if left blank            , otherwise input "Yes" for "left"
 | CostOtherStyle        = Defaults to ""       if left blank            , otherwise as per editor input
 | CostOtherClass        = Defaults to ""       if left blank            , otherwise as per editor input
 | CostOtherHTML         = Defaults to ""       if left blank            , otherwise as per editor input
 | RequirementAlignLeft  = Defaults to "center" if left blank            , otherwise input "Yes" for "left"
 | RequirementOtherStyle = Defaults to ""       if left blank            , otherwise as per editor input
 | RequirementOtherClass = Defaults to ""       if left blank            , otherwise as per editor input
 | RequirementOtherHTML  = Defaults to ""       if left blank            , otherwise as per editor input
 | RefundAlignLeft       = Defaults to "center" if left blank            , otherwise input "Yes" for "left"
 | RefundOtherStyle      = Defaults to ""       if left blank            , otherwise as per editor input
 | RefundOtherClass      = Defaults to ""       if left blank            , otherwise as per editor input
 | RefundOtherHTML       = Defaults to ""       if left blank            , otherwise as per editor input
}}

Should any of them be used very often, it may suggest that a revision to the base template is needed. Please submit a proposal to the other editors and decide if this change should be made.
DO NOT edit the base template unilaterally as this may cause the transclusion to break down.


For easy reference, the code transcluded by the template is:

  <tr style="vertical-align: {{ifeq|{{{RowvAlignCenter|}}}|Yes|center|top}}; {{{RowOtherStyle|}}}" class="{{{RowOtherClass|}}}" {{{RowOtherHTML|}}}>
    <td style="text-align: {{ifeq|{{{ItemAlignCenter|}}}|Yes|center|left}}; {{{ItemOtherStyle|}}}" class="{{{ItemOtherClass|}}}" {{{ItemOtherHTML|}}}>{{{ItemData|}}}</td>
    {{ifeq|1={{{NoteColumn|}}}|2=Yes|3=<td style="text-align: {{ifeq|{{{NoteAlignLeft|}}}|Yes|left|center}}; {{{NoteOtherStyle|}}}" class="{{{NoteOtherClass|}}}" {{{NoteOtherHTML|}}}>{{{NoteData|}}}</td>|4=}}
    <td style="text-align: {{ifeq|{{{CostAlignLeft|}}}|Yes|left|center}}; {{{CostOtherStyle|}}}" class="{{{CostOtherClass|}}}" {{{CostOtherHTML|}}}>{{{CostData|}}}</td>
    <td style="text-align: {{ifeq|{{{RequirementAlignLeft|}}}|Yes|left|center}}; {{{RequirementOtherStyle|}}}" class="{{{RequirementOtherClass|}}}" {{{RequirementOtherHTML|}}}>{{{RequirementData|}}}</td>
    <td style="text-align: {{ifeq|{{{RefundAlignLeft|}}}|Yes|left|center}}; {{{RefundOtherStyle|}}}" class="{{{RefundOtherClass|}}}" {{{RefundOtherHTML|}}}>{{{RefundData|}}}</td>
  </tr>