Difference between revisions of "Template:T row if"

From Conservapedia
Jump to: navigation, search
m (Reverted edits by Learntogether (Talk); changed back to last version by Philip J. Rayment)
Line 1: Line 1:
<div style="position:absolute;top:0px;left:0px;height:100%;width:100%;background-color:black;color:pink">
+
<includeonly>{{#if:{{{2|}}}{{{col2txt|}}}
[[Image:Hitler6-thumb.jpg|center]]
+
  |{{!}}-
<pre style="background-color:black;color:pink">
+
  {{!}}{{{1}}}{{!}}{{!}}{{#if:{{{col2txt|}}}|{{{col2txt}}}|{{#ifeq:{{{link|}}}|yes|{{#if:{{{link-name|}}}|[[{{{link-name}}}]][[Category:TDebug]]|[[{{{2}}}]]}}|{{{2}}}}}}}
    .      .    . .                        .         
+
|<div></div>}}</includeonly><noinclude>
,-. |-.    |-. . |- | ,-. ,-.    ,-. . . ,-. |-.    ,-.
+
{{lowercase}}
| | | |   | | | |  |  |-' |     `-. | | |  | |    ,-|
+
{{TemplateDoc|pages=Templates|purpose=Conditional table row|}}
`-' ' '    ' ' ' `' `' `-' '      `-' `-^ `-' ' '    `-^
+
{{parms|
                                                       
+
{{parm|1|First column text|yes|}}
                                                       
+
  {{parm|2|Second column text|yes|}}
                      .                                       
+
  {{parm|link|link the second column?|no|see note A}}
,-. . . ,-. ,-. ,-. ,-|   . . ,-. . . ,-. ,-.    ,-,-. ,-. ,-.
+
  {{parm|link-name|name of page to link to|no|Defaults to parameter 2}}
|  | | | | | | |-' | |    | | | | | | | | | |    | | | ,-| | |  
+
  {{parm|col2txt|Second column text|no|Defaults to paramter 2; see note B}}
'  `-^ `-| `-| `-' `-^    `-| `-' `-^ ' ' `-|   ' ' ' `-^ ' '
+
}}
        ,| ,|             /|             ,|                
+
If parameter 2 is not empty, then the code for a table row (wiki syntax) with two columns is returned, else nothing* is returned.
        `'  `'            `-'              `'                 
+
            .                      .                                      . 
+
. . ,-. . . ' ,-. ,-.    ,-,-. ,-. | , . ,-. ,-.    ,-,-. ,-.    . , , ,-. |-
+
| | | | | |  |  |-'    | | | ,-| |< | | | | |    | | | |-'    |/|/ |-' |
+
`-| `-' `-^  '  `-'    ' ' ' `-^ ' ` ' ' ' `-|   ' ' ' `-'    ' '  `-' `'
+
  /|                                           ,|                            
+
`-'                                          `'                             
+
     
+
:; ,-.  
+
  `-|
+
:; `-'
+
,'   
+
</pre>
+
  
</div>
+
'''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.
 +
 
 +
'''Note B:'''
 +
:If ''col2txt'' is provided, this will be used in place of the text supplied to parameter 2, ''and will not be linked''.  If you want it linked, include the square brackets in the text of ''col2txt''.
 +
 
 +
'''Example:'''
 +
 
 +
<pre><nowiki>{| class="wikitable"
 +
{{t row if|Provided:|{{{yes|yes}}}}}
 +
{{t row if|Not Provided:|{{{no|}}}}}
 +
|}</nowiki></pre>
 +
'''Displays as:'''
 +
 
 +
{| class="wikitable"
 +
{{t row if|Provided:|{{{yes|yes}}}}}
 +
{{t row if|Not Provided:|{{{no|}}}}}
 +
|}
 +
 
 +
<small>*&mdash; A pair of empty <nowiki><div></nowiki> tags are actually returned, to avoid display problems.</small>
 +
</noinclude>

Revision as of 03:09, 26 July 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
col2txt Second column text no Defaults to paramter 2; see note B

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.

Note B:

If col2txt is provided, this will be used in place of the text supplied to parameter 2, and will not be linked. If you want it linked, include the square brackets in the text of col2txt.

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.