See something you'd like to change or add, but you've never edited an open encyclopædia before? This overview was written to help absolute beginners get started.
Template:t row if
From A Storehouse of Knowledge
| Template: T row if | |
|---|---|
| Use on | Templates |
| Use for | Conditional table row |
| Category template applies to page | (none) |
| Template Parameters (See Template style manual). | ||||
|---|---|---|---|---|
| Name | Purpose | Required? | SMW property | Comment |
| 1 | First column text | yes | ||
| 2, 2 L | Second column text | See note A | ||
If parameter 2 is not empty, then the code for a table row (wiki syntax) with two columns is returned, else nothing* is returned. The table row has a new row indicator ({{!-}}) before the row.
Note A:
- Parameter 2 take priority over parameter 2 L
Example:
{| class="wikitable"
{{t row if|Provided:|yes}}
{{t row if|Not Provided:}}
|}
Displays as:
| Provided: | yes |
- See also
The following templates are useful in conjunction with this template.
- {{2 if 1}}: returns argument 2 if argument 1 is not blank.
- This allows this template to output a row with a linked or otherwise modified version of the argument without outputting a row if the argument is not supplied.
- {{1 of 2}}: returns argument 1 if supplied, else argument 2.
- This allows this template to return a row if either of two arguments are supplied, and no row if no argument is supplied.
*— A pair of empty <div> tags are actually returned, to avoid display problems.
NB: Heavily adapted from my own work on Conservapedia.
