Template:Infobox/doc: Difference between revisions

Jump to navigation Jump to search
no edit summary
(A working infobox and some tutorial code)
 
No edit summary
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: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
 
|belowstyle =
|below = Below text
}}


<pre style="overflow: auto">
{{Infobox
{{Infobox
|bodystyle  = width:20em;
|bodystyle  = width:20em;
Line 43: Line 71:
|below = Below text
|below = Below text
}}
}}
</pre>
{{clear}}
59

edits

Navigation menu