FANDOM


(Update)
(Update)
Line 9: Line 9:
 
|- style="font-size:10px;font-family:monospace;"
 
|- style="font-size:10px;font-family:monospace;"
 
| valign="top" |
 
| valign="top" |
<poem>
+
<poem style="color:purple;">
 
<onlyinclude<nowiki/>><<nowiki/>infobox>
 
<onlyinclude<nowiki/>><<nowiki/>infobox>
 
<title source="title"><default>'<nowiki/>'Unknown'<nowiki/>'</default></title>
 
<title source="title"><default>'<nowiki/>'Unknown'<nowiki/>'</default></title>
   
  +
<span style="color:orange;">
  +
<image source="image"><caption source="imagecaption"/></image></span>
   
<image source="image"><caption source="imagecaption"/></image>
 
   
  +
<group><span style="color:green;">
  +
<header>Some attributes</header></span>
   
  +
<span style="color:red;">
  +
<data source="first"><label>First</label>
  +
<default>'<nowiki/>'Unknown'<nowiki/>'</default></data>
  +
<data source="second"><label>Second</label>
  +
<default>'<nowiki/>'Unknown'<nowiki/>'</default></data>
  +
<data source="third"><label>Third</label>
  +
<default>'<nowiki/>'Unknown'<nowiki/>'</default></data>
  +
</span> </group>
   
+
<group><span style="color:green;">
+
<header>Other attributes</header></span>
<group>
+
<span style="color:blue;">
<header>Some attributes</header>
 
 
 
<data source="first"><label>First</label><default>'<nowiki/>'Unknown'<nowiki/>'</default></data>
 
<data source="second"><label>Second</label><default>'<nowiki/>'Unknown'<nowiki/>'</default></data>
 
<data source="third"><label>Third</label><default>'<nowiki/>'Unknown'<nowiki/>'</default></data>
 
</group>
 
<group>
 
<header>Other attributes</header>
 
 
 
 
<data source="fourth"><label>Fourth</label></data>
 
<data source="fourth"><label>Fourth</label></data>
 
<data source="fifth"><label>Fifth</label></data>
 
<data source="fifth"><label>Fifth</label></data>
 
<data source="sixth"><label>Sixth</label></data>
 
<data source="sixth"><label>Sixth</label></data>
  +
</span> </group>
  +
  +
<group layout="horizontal"><span style="color:green;">
  +
<header>Order</header></span>
  +
<span style="color:cyan;">
  +
<data source="previous"><label>Previous</label></data>
  +
<data source="next"><label>Next</label></data></span>
 
</group>
 
</group>
<group layout="horizontal">
+
</infobox></<nowiki/>onlyinclude><noin<nowiki/>clude><b<nowiki/>r style="clear:both;"/>
<header>Order</header>
 
   
   
<data source="previous"><label>Previous</label></data>
 
<data source="next"><label>Next</label></data>
 
</group>
 
</infobox></<nowiki/>onlyinclude><noin<nowiki/>clude><br style="clear:both;"/>
 
 
{{documentation}<nowiki/>}</no<nowiki/>include>
 
{{documentation}<nowiki/>}</no<nowiki/>include>
   
Line 37: Line 51:
   
 
</poem>
 
</poem>
|
+
| valign="top" |
 
<poem>
 
<poem>
<span style="color:purple;">Opens the infobox. This heading is
+
<span style="color:purple;">Opens the infobox. This title is
 
the top of the infobox: if unspecified it says "Unknown".</span>
 
the top of the infobox: if unspecified it says "Unknown".</span>
 
<span style="color:grey;">NOTE: whitespace (linebreaks) don't affect the code.</span>
 
<span style="color:grey;">NOTE: whitespace (linebreaks) don't affect the code.</span>
 
<span style="color:orange;">
 
<span style="color:orange;">
Here we present the image to be used in the article.
+
Here is the image and image's caption.
The code checks if the article defined
+
If {{{image}}} or {{{imagecaption}}} is undefined,
{{{image}}}. If not, the entire field is omitted.
+
the image or caption is omitted.</span>
We also present the small caption under the image. As above,
 
all is omitted if {{{imagecaption}}} isn't defined.</span>
 
 
<span style="color:green;">
 
<span style="color:green;">
 
 
The first two-column header. It says "Some attributes".
 
The first two-column header. It says "Some attributes".
 
Feel free to change "Some attributes" to your needs!</span>
 
Feel free to change "Some attributes" to your needs!</span>
 
 
 
<span style="color:red;">Each of these is a field in the infobox.
 
<span style="color:red;">Each of these is a field in the infobox.
  +
They represent {{{first}}}, {{{second}}}, {{{third}}}.
 
By default, they say "First", "Second", "Third".
 
By default, they say "First", "Second", "Third".
 
If undefined, they say "Unknown".</span>
 
If undefined, they say "Unknown".</span>
  +
  +
  +
   
 
<span style="color:green;">
 
<span style="color:green;">
The second two-column header.
+
The second two-column header.</span>
Again, feel free to change it, or remove entirely!</span>
 
 
 
 
<span style="color:blue;">These are 3 infobox fields, but they're different
 
<span style="color:blue;">These are 3 infobox fields, but they're different
from the previous (red) fields. These rows
+
from the previous (red) fields. They'll be totally
will be totally hidden, if "fourth", "fifth", etc
+
will be totally hidden, if their parameters are undefined.
are undefined. The red parameters would have displayed
 
under similar circumstances, only to say "Unknown".
 
 
 
+
Decide what kind is more suited to your needs.
+
If you want to use this format but adapt it,
+
<span style="color:green;">The third two-column header.</span>
you will have to change several bits of the code.
+
+
<span style="color:cyan;">Because of the layout="horizontal", These two parameters
+
display side-by-side instead of one after the other.</span>
You will have to change the following to meet your needs:
+
1. {{<nowiki />{sixth|}}} on this line
+
<span style="color:purple;">Closes the infobox.
2. "Sixth" on this line
 
3. {{{sixth}}} on this line
 
4. | sixth = in the documentation</span>
 
 
<span style="color:purple;">|<nowiki/>} closes the table, thus closing the infobox.
 
 
It's best not to mess with this.
 
It's best not to mess with this.
 
 
 
 
Now the table and infobox is closed.
 
Now the table and infobox is closed.

Revision as of 21:34, December 5, 2015

An explanation of the code of the infobox
Note that linebreaks have been added, sparingly, for readability on this page.
The code An explanation

<onlyinclude><infobox>
<title source="title"><default>''Unknown''</default></title>


<image source="image"><caption source="imagecaption"/></image>



<group>
<header>Some attributes</header>



<data source="first"><label>First</label>
<default>''Unknown''</default></data>
<data source="second"><label>Second</label>
<default>''Unknown''</default></data>
<data source="third"><label>Third</label>
<default>''Unknown''</default></data>
</group>

<group>
<header>Other attributes</header>


<data source="fourth"><label>Fourth</label></data>
<data source="fifth"><label>Fifth</label></data>
<data source="sixth"><label>Sixth</label></data>
</group>

<group layout="horizontal">
<header>Order</header>


<data source="previous"><label>Previous</label></data>
<data source="next"><label>Next</label></data>

</group>
</infobox></onlyinclude><noinclude><br style="clear:both;"/>


{{documentation}}</noinclude>


Opens the infobox. This title is
the top of the infobox: if unspecified it says "Unknown".

NOTE: whitespace (linebreaks) don't affect the code.

Here is the image and image's caption.
If {{{image}}} or {{{imagecaption}}} is undefined,
the image or caption is omitted.


The first two-column header. It says "Some attributes".
Feel free to change "Some attributes" to your needs!

 
Each of these is a field in the infobox.
They represent {{{first}}}, {{{second}}}, {{{third}}}.
By default, they say "First", "Second", "Third".
If undefined, they say "Unknown".






The second two-column header.

 
These are 3 infobox fields, but they're different
from the previous (red) fields. They'll be totally
will be totally hidden, if their parameters are undefined.
 


The third two-column header.

Because of the layout="horizontal", These two parameters
display side-by-side instead of one after the other.


Closes the infobox.
It's best not to mess with this.
 
Now the table and infobox is closed.
This last template displays documentation.

Community content is available under CC-BY-SA unless otherwise noted.