Template:Infobox/doc: Difference between revisions

m
no edit summary
(A working infobox and some tutorial code)
 
mNo edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 11: Line 11:
}}</pre>
}}</pre>


header1 will be shown if any of item_one, item_two, or item_three is defined. If none of the three parameters are defined the header won't be shown.
Here is an example infobox


The trick to this is that the "if" returns false only if there is nothing whatsoever in the conditional section, so only if all three of item_one, item_two and item_three are undefined will the if statement fail.
{{Infobox
|bodystyle  = width:20em;
|name        =
|title      = Test Infobox
|titlestyle  =
|headerstyle =
|labelstyle  = width:33%
|datastyle  =


|header1 =
|label1  = Label 1
|data1  = Data 1
|header2 =
|label2  = Label 2
|data2  = Data 2
|header3 =
|label3  = Label 3
|data3  = Data 3
|header4 = Header 4
|label4  =
|data4  =
|header5 =
|label5  = Label 5
|data5  = Data 5
|belowstyle =
|below = Below text
}}
<pre style="overflow: auto">
{{Infobox
{{Infobox
|bodystyle  = width:20em;
|bodystyle  = width:20em;
Line 43: Line 70:
|below = Below text
|below = Below text
}}
}}
</pre>
{{clear}}
[[Category:Infoboxes]]
[[Category:Base templates]]
9,929

edits