Difference between revisions of "Template:T row if"
Jump to navigation
Jump to search
(Nope, but I see an error) |
(Almost, try this) |
||
| Line 1: | Line 1: | ||
<includeonly>{{#if:{{{2|}}} | <includeonly>{{#if:{{{2|}}} | ||
|{{!}}- | |{{!}}- | ||
| − | {{!}}{{{1}}}{{!}}{{!}}{{#ifeq:{{{link|}}}|yes|{{#if:{{{link-name|}}}|[[{{{link-name}}}]]|[[{{{2}}}]]}}|{{{2 | + | {{!}}{{{1}}}{{!}}{{!}}{{#ifeq:{{{link|}}}|yes|{{#if:{{{link-name|}}}|[[{{{link-name}}}]]|[[{{{2}}}]]}}|{{{2}}}}} |
|<div></div>}}</includeonly><noinclude> | |<div></div>}}</includeonly><noinclude> | ||
{{lowercase}} | {{lowercase}} | ||
Revision as of 03:24, June 18, 2007
| Template: T row if | |
|---|---|
| Use on | Templates |
| Use for | Conditional table row |
| Category template applies to page | (none) |
| Template Parameters (See using templates). | |||
|---|---|---|---|
| Name | Purpose | Required? | Comment |
| 1 | First column text | yes | |
| 2 | Second column text | yes | |
| link | link the second column? | no | see note A |
| link-name | name of page to link to | no | Defaults to parameter 2 |
If parameter 2 is not empty, then the code for a table row (wiki syntax) with two columns is returned, else nothing* is returned.
Note A:
- If link=yes, the value of the second column will be a Wikilink, to the page in parameter link-name, or if that is not provided, the page in parameter 2.
Example:
{| class="wikitable"
{{t row if|Provided:|{{{yes|yes}}}}}
{{t row if|Not Provided:|{{{no|}}}}}
|}
Displays as:
| Provided: | yes |
*— A pair of empty <div> tags are actually returned, to avoid display problems.