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
Jump to: navigation, search

Template: T row if
Use on/in 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


{| 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.
  • {{linked value}}: returns the (first) argument as a Wikilink, unless it already has a link.
This is an alternative to {{2 if 1}} and {{1 of 2}} in the case that the parameter is to be linked.

*— A pair of empty <div> tags are actually returned, to avoid display problems.

NB: Heavily adapted from my own work on Conservapedia.

Personal tools

visitor navigation
contributor navigation