FANDOM


(Move)
(Undeleted from Template:Thisismyrofl-infobox-explain and subpages)
Line 1: Line 1:
<!---->
+
{| class="wikitable mw-collapsible mw-collapsed" style="margin-left:auto;margin-right:auto; line-height:14px;"
 
|-
 
|-
<!---->
+
! colspan="2" | An explanation of the code of the infobox
  +
|-
  +
| colspan="2" | Note that linebreaks have been added, sparingly, for readability on this page.
  +
|-
  +
! The code
  +
! An explanation
  +
|- style="font-size:10px;font-family:monospace;"
  +
|
  +
<poem>
  +
<span style="color:purple;"><<nowiki/>onlyinclude>{| class="wikia-infobox"
  +
  +
|-
  +
! class="wikia-infobox-header" colspan="2" | {<nowiki/>{<nowiki/>{title|'<nowiki/>'Unknown'<nowiki/>'}}}</span>
  +
  +
<span style="color:orange;">|-
  +
{<nowiki/>{#if: {<nowiki/>{<nowiki/>{image|}}} |
  +
{<nowiki/>{!}} class="wikia-infobox-image" colspan="2" {<nowiki/>{!}}
  +
[[File:{<nowiki/>{<nowiki/>{image}}}|{<nowiki/>{<nowiki/>{imagewidth|210}}}px|{<nowiki/>{<nowiki/>{imagecaption|}}}]]
  +
| }}
  +
  +
|-
  +
{<nowiki/>{#if: {<nowiki/>{<nowiki/>{imagecaption|}}} |
  +
{<nowiki/>{!}} class="wikia-infobox-caption" colspan="2" {<nowiki/>{!}} {<nowiki/>{<nowiki/>{imagecaption}}}
  +
| }}</span>
  +
  +
<span style="color:green;">|-
  +
! colspan="2" |
  +
<<nowiki/>div class="wikia-infobox-section-header">Some attributes<<nowiki/>/div></span>
  +
  +
<span style="color:red;">|-
  +
! First
  +
| {<nowiki/>{<nowiki/>{first|'<nowiki/>'Unknown'<nowiki/>'}}}
  +
  +
|-
  +
! Second
  +
| {<nowiki/>{<nowiki/>{second|'<nowiki/>'Unknown'<nowiki/>'}}}
  +
  +
|-
  +
! Third
  +
| {<nowiki/>{<nowiki/>{third|'<nowiki/>'Unknown'<nowiki/>'}}}</span>
  +
  +
<span style="color:green;">|-
  +
! colspan="2" |
  +
<<nowiki/>div class="wikia-infobox-section-header">Other attributes<<nowiki/>/div></span>
  +
  +
<span style="color:blue;">|-
  +
{<nowiki/>{#if: {<nowiki/>{<nowiki/>{fourth|}}} |
  +
! Fourth
  +
{<nowiki/>{!}} {<nowiki/>{<nowiki/>{fourth}}}
  +
| }}
  +
  +
|-
  +
{<nowiki/>{#if: {<nowiki/>{<nowiki/>{fifth|}}} |
  +
! Fifth
  +
{<nowiki/>{!}} {<nowiki/>{<nowiki/>{fifth}}}
  +
| }}
  +
  +
|-
  +
{<nowiki/>{#if: {<nowiki/>{<nowiki/>{sixth|}}} |
  +
! Sixth
  +
{<nowiki/>{!}} {<nowiki/>{<nowiki/>{sixth}}}
  +
| }}</span>
  +
  +
<span style="color:purple;">|- style="font-size:0; line-height:0;"
  +
! style="width:50%; padding:0" |
  +
! style="width:50%; padding:0" |
  +
  +
|}<<nowiki/>/onlyinclude><<nowiki/>noinclude><<nowiki/>br style="clear:both;"/>
  +
{<nowiki/>{documentation}}<<nowiki/>/noinclude></span>
  +
</poem>
  +
|
  +
<poem>
  +
<span style="color:purple;">Opens the infobox. Every time you see |<nowiki/>-
  +
it means a new row. This line begins with !
  +
which means it's a heading. This heading is
  +
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:orange;">
  +
Here we present the image to be used in the article.
  +
The #if statement checks if the article defined
  +
{{{image}}}. If not, the entire field is omitted.
  +
  +
  +
  +
Here we present the small caption under the image. As above,
  +
all is omitted if {{{imagecaption}}} isn't defined.
  +
</span>
  +
  +
<span style="color:green;">
  +
The first two-column header. It says "Some attributes".
  +
Feel free to change "Some attributes" to your needs!</span>
  +
  +
<span style="color:red;">Each of these is a field in the infobox.
  +
By default, they say "First", "Second", "Third".
  +
If undefined, they say "Unknown".
  +
  +
You can change the fields. Just change
  +
"First" or "Second", and also change
  +
{{{first and {{{second to whatever fits.
  +
  +
You can change the default text from 'Unknown' too.
  +
Remember to change documentation:
  +
| first =
  +
</span>
  +
<span style="color:green;">
  +
The second two-column header.
  +
Again, feel free to change it, or remove entirely!</span>
  +
  +
<span style="color:blue;">These are 3 infobox fields, but they're different
  +
from the previous (red) fields. These rows
  +
will be totally hidden, if "fourth", "fifth", etc
  +
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,
  +
you will have to change several bits of the code.
  +
  +
  +
You will have to change the following to meet your needs:
  +
1. {{<nowiki />{sixth|}}} on this line
  +
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.
  +
  +
  +
Now the table and infobox is closed.
  +
This last template displays documentation.</span>
  +
</poem>

Revision as of 20:53, 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>{| class="wikia-infobox"
 
|-
! class="wikia-infobox-header" colspan="2" | {{{title|''Unknown''}}}

 
|-
{{#if: {{{image|}}} |
{{!}} class="wikia-infobox-image" colspan="2" {{!}}
[[File:{{{image}}}|{{{imagewidth|210}}}px|{{{imagecaption|}}}]]
| }}
 
|-
{{#if: {{{imagecaption|}}} |
{{!}} class="wikia-infobox-caption" colspan="2" {{!}} {{{imagecaption}}}
| }}

 
|-
! colspan="2" |
<div class="wikia-infobox-section-header">Some attributes</div>

 
|-
! First
| {{{first|''Unknown''}}}
 
|-
! Second
| {{{second|''Unknown''}}}
 
|-
! Third
| {{{third|''Unknown''}}}

 
|-
! colspan="2" |
<div class="wikia-infobox-section-header">Other attributes</div>

 
|-
{{#if: {{{fourth|}}} |
! Fourth
{{!}} {{{fourth}}}
| }}
 
|-
{{#if: {{{fifth|}}} |
! Fifth
{{!}} {{{fifth}}}
| }}
 
|-
{{#if: {{{sixth|}}} |
! Sixth
{{!}} {{{sixth}}}
| }}

 
|- style="font-size:0; line-height:0;"
! style="width:50%; padding:0" |
! style="width:50%; padding:0" |
 
|}</onlyinclude><noinclude><br style="clear:both;"/>
{{documentation}}</noinclude>

Opens the infobox. Every time you see |-
it means a new row. This line begins with !
which means it's a heading. This heading is
the top of the infobox: if unspecified it says "Unknown".

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

Here we present the image to be used in the article.
The #if statement checks if the article defined
{{{image}}}. If not, the entire field is omitted.
 
 
 
Here we present the small caption under the image. As above,
all is omitted if {{{imagecaption}}} isn't defined.

 

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.
By default, they say "First", "Second", "Third".
If undefined, they say "Unknown".
 
You can change the fields. Just change
"First" or "Second", and also change
{{{first and {{{second to whatever fits.
 
You can change the default text from 'Unknown' too.
Remember to change documentation:
| first =


The second two-column header.
Again, feel free to change it, or remove entirely!

 
These are 3 infobox fields, but they're different
from the previous (red) fields. These rows
will be totally hidden, if "fourth", "fifth", etc
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,
you will have to change several bits of the code.
 
 
You will have to change the following to meet your needs:
1. {{{sixth|}}} on this line
2. "Sixth" on this line
3. {{{sixth}}} on this line
4. | sixth = in the documentation

 
|} closes the table, thus closing 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.