Template:Infobox: Difference between revisions
(#if isn't working. I think parserfunctions doesn't work) |
No edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly><table class="infobox" style="width: | <includeonly><table class="infobox" style="width: 25%; margin: 0 0 1em 1em; float:right; background:#eee;"> | ||
<caption class="infobox-title" style="background:{{{title-bg-color|#789}}}; color:{{{title-text-color|white}}}; text-align:center; padding:5px 10px">'''{{{name}}}'''</caption> | <caption class="infobox-title" style="background:{{{title-bg-color|#789}}}; color:{{{title-text-color|white}}}; text-align:center; padding:5px 10px">'''{{{name}}}'''</caption> | ||
<tr {{#if:{{{image|}}}||style="display: none;"}}> | <tr {{#if:{{{image|}}}||style="display: none;"}}> | ||
<td colspan="2" class="infobox-image"><center>[[File:{{{image|}}}||{{{image-size|200px}}}]]</center><div class="infobox-caption" {{#if:{{{image-caption|}}}||style="display: none;"}}>{{{image-caption|}}}</div></td> | <td colspan="2" class="infobox-image"><center>[[File:{{{image|}}}||{{{image-size|200px}}}]]</center><div class="infobox-caption" {{#if:{{{image-caption|}}}||style="display: none;"}}>{{{image-caption|}}}</div></td> | ||
</tr> | </tr> | ||
<tr {{#if:{{{ | <tr {{#if:{{{data1|}}}||style="display: none;"}}> | ||
<th scope="row" class="infobox-label" style="white-space: nowrap">{{{label1|}}}</th> | <th scope="row" class="infobox-label" style="white-space: nowrap">{{{label1|}}}</th> | ||
<td class="infobox-data">{{{data1|}}}</td> | <td class="infobox-data">{{{data1|}}}</td> | ||
</tr> | </tr> | ||
<tr {{#if:{{{ | <tr {{#if:{{{data2|}}}||style="display: none;"}}> | ||
<th scope="row" class="infobox-label" style="white-space: nowrap">{{{label2|}}}</th> | <th scope="row" class="infobox-label" style="white-space: nowrap">{{{label2|}}}</th> | ||
<td class="infobox-data">{{{data2|}}}</td> | <td class="infobox-data">{{{data2|}}}</td> | ||
</tr> | </tr> | ||
<tr {{#if:{{{ | <tr {{#if:{{{data3|}}}||style="display: none;"}}> | ||
<th scope="row" class="infobox-label" style="white-space: nowrap">{{{label3|}}}</th> | <th scope="row" class="infobox-label" style="white-space: nowrap">{{{label3|}}}</th> | ||
<td class="infobox-data">{{{data3|}}}</td> | <td class="infobox-data">{{{data3|}}}</td> | ||
</tr> | </tr> | ||
<tr {{#if:{{{ | <tr {{#if:{{{data4|}}}||style="display: none;"}}> | ||
<th scope="row" class="infobox-label" style="white-space: nowrap">{{{label4|}}}</th> | <th scope="row" class="infobox-label" style="white-space: nowrap">{{{label4|}}}</th> | ||
<td class="infobox-data">{{{data4|}}}</td> | <td class="infobox-data">{{{data4|}}}</td> | ||
</tr> | </tr> | ||
<tr {{#if:{{{ | <tr {{#if:{{{data5|}}}||style="display: none;"}}> | ||
<th scope="row" class="infobox-label" style="white-space: nowrap">{{{label5|}}}</th> | <th scope="row" class="infobox-label" style="white-space: nowrap">{{{label5|}}}</th> | ||
<td class="infobox-data">{{{data5|}}}</td> | <td class="infobox-data">{{{data5|}}}</td> | ||
</tr> | </tr> | ||
<tr {{#if:{{{ | <tr {{#if:{{{data6|}}}||style="display: none;"}}> | ||
<th scope="row" class="infobox-label" style="white-space: nowrap">{{{label6|}}}</th> | <th scope="row" class="infobox-label" style="white-space: nowrap">{{{label6|}}}</th> | ||
<td class="infobox-data">{{{data6|}}}</td> | <td class="infobox-data">{{{data6|}}}</td> | ||
</tr> | </tr> | ||
<tr {{#if:{{{ | <tr {{#if:{{{data7|}}}||style="display: none;"}}> | ||
<th scope="row" class="infobox-label" style="white-space: nowrap">{{{label7|}}}</th> | <th scope="row" class="infobox-label" style="white-space: nowrap">{{{label7|}}}</th> | ||
<td class="infobox-data">{{{data7|}}}</td> | <td class="infobox-data">{{{data7|}}}</td> | ||
</tr> | </tr> | ||
<tr {{#if:{{{ | <tr {{#if:{{{data8|}}}||style="display: none;"}}> | ||
<th scope="row" class="infobox-label" style="white-space: nowrap">{{{label8|}}}</th> | <th scope="row" class="infobox-label" style="white-space: nowrap">{{{label8|}}}</th> | ||
<td class="infobox-data">{{{data8|}}}</td> | <td class="infobox-data">{{{data8|}}}</td> | ||
</tr> | </tr> | ||
<tr {{#if:{{{ | <tr {{#if:{{{data9|}}}||style="display: none;"}}> | ||
<th scope="row" class="infobox-label" style="white-space: nowrap">{{{label9|}}}</th> | <th scope="row" class="infobox-label" style="white-space: nowrap">{{{label9|}}}</th> | ||
<td class="infobox-data">{{{data9|}}}</td> | <td class="infobox-data">{{{data9|}}}</td> | ||
Line 97: | Line 97: | ||
|data3 = English | |data3 = English | ||
}} | }} | ||
[[Category:Infobox templates]] | |||
</noinclude> | </noinclude> |
Latest revision as of 00:56, 25 July 2025
Default infobox template.
Although wikis usually use other technology to implement infoboxes, I don't think the commands are currently enabled and I don't have the power to turn it on. So this editor BTackt (talk) has decided to improve the poor and ugly HTML implementation into a slightly better and ugly HTML implementation.
Currently equipped for up to 9 rows in the info table.
Intended usage is as a default template for other infobox templates.
Attributes
title
- Title text for the infobox.
title-bg-color (default: #789)
- Background color in hexcode for the title of the infobox.
title-text-color (default: white)
- Text color in hexcode for the title of the infobox. Recommended to switch to
black
if the title-bg-color has been switched to a light color.
image (optional)
- Filename of image uploaded to this wiki.
image-size (default: 200px)
- Size of the image to be displayed.
image-caption (optional)
- Caption to be displayed under the image.
label1 (optional)
- Label of the first item.
data1 (optional)
- Data of the first item.
label2 (optional)
- Label of the second item.
data2 (optional)
- Data of the second item.
etc...
label9 (optional)
- Label of the ninth item.
data9 (optional)
- Data of the ninth item.
Usage example
{{Infobox |name = Example Infobox |label1 = Color |data1 = red |label2 = Shape |data2 = star |label3 = Language |data3 = English }}
Color | red |
---|---|
Shape | star |
Language | English |