Welcome to the Lylat Wiki, all about the Star Fox series! If you'd like to help out, please take a look at our community portal.

Difference between revisions of "Help:Infoboxes"

From Lylat Wiki, your source on Star Fox information. By Fans, for Fans.
Jump to navigationJump to search
Line 8: Line 8:
Our info box start off with 5 areas to be used, plus the ability to add more. For example:  
Our info box start off with 5 areas to be used, plus the ability to add more. For example:  
<pre>
<pre>
{{InfoBoxBegin | class = {{{class|}}} Fruit | caption = Fruit | style= {{{style|}}} }}  
{{InfoBoxBegin v2.0
{{!-}}
| class = {{{class|}}} Fruit wikitable
! colspan=2 {{!}} Details
| title = Fruits
{{InfoBoxDetails
| picture = {{{picture|}}}
| picture_size = {{{picture_size}}}
| caption = {{{caption|}}}  
| colors = Wiki
| style= {{{style|}}} 
| Info1name = Colors
| Info1name = Colors
| Info1details = {{{colors|}}}
| Info1details = {{{colors|}}}
Line 22: Line 26:
| Info5name = [[related info]]
| Info5name = [[related info]]
| Info5details = {{{related_info|}}}
| Info5details = {{{related_info|}}}
}}
{{InfoBoxEntry v2.0
| colors = Wiki
| InfoName = Pie?
| InfoDetails = {{{pie}}}
}}
}}
<!-- {{infoboxentry}} -->
<!-- {{infoboxentry}} -->
{{InfoBoxEnd}}
{{InfoBoxEnd v2.0
| name = WkiInfoBox v2.0
| colors = Wiki
}}
</pre>
</pre>


comes out looking like:  
comes out looking like:  
{{InfoBoxBegin | class = {{{class|}}} Fruit | caption = Fruit | style= {{{style|}}} }}  
{{InfoBoxBegin v2.0
{{!-}}
| class = {{{class|}}} Fruit wikitable
! colspan=2 {{!}} Details
| title = Fruits
{{InfoBoxDetails
| picture = {{{picture|}}}
| picture_size = {{{picture_size}}}
| caption = {{{caption|}}}  
| colors = Wiki
| style= {{{style|}}} 
| Info1name = Colors
| Info1name = Colors
| Info1details = {{{colors|}}}
| Info1details = {{{colors|}}}
Line 43: Line 59:
| Info5details = {{{related_info|}}}
| Info5details = {{{related_info|}}}
}}
}}
<!-- {{}} -->
{{InfoBoxEntry v2.0
{{InfoBoxEnd}}
| colors = Wiki
| InfoName = Pie?
| InfoDetails = {{{pie}}}
}}
<!-- {{infoboxentry}} -->
{{InfoBoxEnd v2.0
| name = WkiInfoBox v2.0
| colors = Wiki
}}




Each row in the table has 2 cells: Info#name and Info#details, where # is the row number. [[Template:InfoBoxDetails]] has room for 5 rows, and [[Template:infoboxentry]] can dynamically add a row for each time it's used. [[Template:InfoBoxBegin]] and [[Template:InfoBoxEnd]] complete the box with all the needed info.  
Each row in the table has 2 cells: Info#name and Info#details, where # is the row number. [[Template:InfoBoxBegin v2.0]] has room for 5 rows, and [[Template:infoboxentry v2.0]] can dynamically add a row for each time it's used. [[Template:InfoBoxBegin v2.0]] and [[Template:InfoBoxEnd v2.0]] complete the box with all the needed info.  


== Parameters ==
== Parameters ==
when using a infobox within another template, like [[Template:VehicleInfobox]], you can specify the name of each row to something related to related usage of the template. In our example above, We are expecting this particular infobox to be used on Fruit related pages; therefore we told the template we are inheriting that we want the 5 fields to be called: Colors, Taste, Baked, Salted and "related info".  
when using a infobox within another template, like [[Template:VehicleInfobox v2.0]], you can specify the name of each row to something related to related usage of the template. In our example above, We are expecting this particular infobox to be used on Fruit related pages; therefore we told the template we are inheriting that we want the 5 fields to be called: Colors, Taste, Baked, Salted and "related info".  


Now, being we are using multiple layers of embedding templates, we want to make sure the end user's information is pass through our template and up to the core infobox template that actaully uses the infomation. This is where the parameters with a varible on the end come in handy. They look like <nowiki>| Info4details = {{{salted|}}}</nowiki> and if the end user specifies a value for "salted", we take it and pass it along as "Info4details". Neat, isn't it?
Now, being we are using multiple layers of embedding templates, we want to make sure the end user's information is pass through our template and up to the core infobox template that actaully uses the infomation. This is where the parameters with a varible on the end come in handy. They look like <nowiki>| Info4details = {{{salted|}}}</nowiki> and if the end user specifies a value for "salted", we take it and pass it along as "Info4details". Neat, isn't it?
Line 60: Line 84:


<pre>
<pre>
{{InfoBoxBegin | class = {{{class|}}} Character color5 | caption = [[Lylat Wiki:Characters|Character]] | style= {{{style|}}} }}  
{{InfoBoxBegin v2.0
{{!-}}
| class = {{{class|}}} Character color5  
{{!}} colspan=2 {{!}}
| title = Characters
{{#if: {{{picture|}}} | [[File:{{{picture}}}|100px]] | Have an image of this character? Why not [[Special:Upload|upload]] it? }}
| picture = {{{picture|}}}
{{!-}}
| picture_size = {{{picture_size}}}
! colspan=2 {{!}} Details
| caption = {{{caption|}}}  
{{InfoBoxDetails
| colors = Character
| style= {{{style|}}}
| Info1name = name
| Info1name = name
| Info1details = {{{name}}}
| Info1details = {{{name}}} ({{{jname}}})
| Info2name = [[home planet]]
| Info2name = [[home planet]]
| Info2details = {{{home_planet|}}}
| Info2details = {{{home_planet|}}}
Line 75: Line 100:
| Info4name = [[premier game]]
| Info4name = [[premier game]]
| Info4details = {{{premier_game|}}}
| Info4details = {{{premier_game|}}}
| Info5name = [[affiliations]]
| Info5name = [[affiliations (in-universe) |affiliations]]
| Info5details = {{{affiliations|}}}
| Info5details = {{{affiliations|}}}
}}
}}
<!-- {{infoboxentry}} -->
{{!-}}
{{InfoBoxEnd}}
{{#if: {{{alias|}}} |
{{InfoBoxEntry v2.0
| colors = Character
| InfoName = Alais
| InfoDetails = {{{alias}}}
}}
| }}
{{InfoBoxEnd
| name = CharacterInfoBox v2.0
| colors = Character
}}<includeonly>[[Category:{{{name}}}| ]]</includeonly><noinclude>
 
{{doc}}{{auto-cat2|InfoBox Usage Templates|Character Templates}}</noinclude>
 
</pre>
</pre>
and came out like this  
and came out like this  
{{InfoBoxBegin | class = {{{class|}}} Character color5 | caption = [[Lylat Wiki:Characters|Character]] | style= {{{style|}}} }}  
{{InfoBoxBegin v2.0
{{!-}}
| class = {{{class|}}} Character color5  
{{!}} colspan=2 {{!}}
| title = Characters
{{#if: {{{picture|}}} | [[File:{{{picture}}}|100px]] | Have an image of this character? Why not [[Special:Upload|upload]] it? }}
| picture = {{{picture|}}}
{{!-}}
| picture_size = {{{picture_size}}}
! colspan=2 {{!}} Details
| caption = {{{caption|}}}  
{{InfoBox
| colors = Character
| style= {{{style|}}}
| Info1name = name
| Info1name = name
| Info1details = {{{name}}}
| Info1details = {{{name}}} ({{{jname}}})
| Info2name = [[home planet]]
| Info2name = [[home planet]]
| Info2details = {{{home_planet|}}}
| Info2details = {{{home_planet|}}}
Line 97: Line 136:
| Info4name = [[premier game]]
| Info4name = [[premier game]]
| Info4details = {{{premier_game|}}}
| Info4details = {{{premier_game|}}}
| Info5name = [[affiliations]]
| Info5name = [[affiliations (in-universe) |affiliations]]
| Info5details = {{{affiliations|}}}
| Info5details = {{{affiliations|}}}
}}
}}
<!-- {{infoboxentry}} -->
{{!-}}
{{InfoBoxEnd}}
{{#if: {{{alias|}}} |
{{InfoBoxEntry v2.0
| colors = Character
| InfoName = Alais
| InfoDetails = {{{alias}}}
}}
| }}
{{InfoBoxEnd
| name = CharacterInfoBox v2.0
| colors = Character
}}
 
 


Becuase of the way we set up parameters, a user of the characterinfobox only needs to place this in the artilce:
Becuase of the way we set up parameters, a user of the characterinfobox only needs to place this in the artilce:


<pre>
<pre>
{{CharacterInfoBox
{{CharacterInfoBox v2.0
| name =  
| name =  
| class =
| style = 
| picture =  
| picture =  
| name =  
| caption =  
| home_planet =
| home_planet =
| role =
| role =
Line 120: Line 169:


== Other info boxes ==
== Other info boxes ==
* [[Template:VehicleInfoBox]]
{{InfoBox Templates}}





Revision as of 17:31, 30 August 2010

Shortcuts: Usage , [[ Template:LW:IB ]]


Info boxes are a place to store simple facts related to the article, and putting them in a small, compact table off to the side.

Core of the infobox

Our info box start off with 5 areas to be used, plus the ability to add more. For example:

{{InfoBoxBegin v2.0 
| class = {{{class|}}} Fruit wikitable
| title = Fruits
| picture = {{{picture|}}}
| picture_size = {{{picture_size}}}
| caption = {{{caption|}}} 
| colors = Wiki
| style= {{{style|}}}  
| Info1name = Colors
| Info1details = {{{colors|}}}
| Info2name = Taste 
| Info2details = {{{taste|}}}
| Info3name = Baked
| Info3details = {{{baked|}}}
| Info4name = Salted
| Info4details = {{{salted|}}}
| Info5name = [[related info]]
| Info5details = {{{related_info|}}}
}}
{{InfoBoxEntry v2.0
| colors = Wiki
| InfoName = Pie?
| InfoDetails = {{{pie}}}
}}
<!-- {{infoboxentry}} -->
{{InfoBoxEnd v2.0
| name = WkiInfoBox v2.0
| colors = Wiki
}}

comes out looking like: Template:InfoBoxBegin v2.0 Template:InfoBoxEntry v2.0 Template:InfoBoxEnd v2.0


Each row in the table has 2 cells: Info#name and Info#details, where # is the row number. Template:InfoBoxBegin v2.0 has room for 5 rows, and Template:infoboxentry v2.0 can dynamically add a row for each time it's used. Template:InfoBoxBegin v2.0 and Template:InfoBoxEnd v2.0 complete the box with all the needed info.

Parameters

when using a infobox within another template, like Template:VehicleInfobox v2.0, you can specify the name of each row to something related to related usage of the template. In our example above, We are expecting this particular infobox to be used on Fruit related pages; therefore we told the template we are inheriting that we want the 5 fields to be called: Colors, Taste, Baked, Salted and "related info".

Now, being we are using multiple layers of embedding templates, we want to make sure the end user's information is pass through our template and up to the core infobox template that actaully uses the infomation. This is where the parameters with a varible on the end come in handy. They look like | Info4details = {{{salted|}}} and if the end user specifies a value for "salted", we take it and pass it along as "Info4details". Neat, isn't it?

Lets take a look at another example.

CharacterInfobox template

at the time of this writing, CharacterInfobox looked like this:

{{InfoBoxBegin v2.0 
| class = {{{class|}}} Character color5 
| title = Characters
| picture = {{{picture|}}}
| picture_size = {{{picture_size}}}
| caption = {{{caption|}}} 
| colors = Character 
| style= {{{style|}}}  
| Info1name = name
| Info1details = {{{name}}} ({{{jname}}})
| Info2name = [[home planet]]
| Info2details = {{{home_planet|}}}
| Info3name = [[role]]
| Info3details = {{{role|}}}
| Info4name = [[premier game]]
| Info4details = {{{premier_game|}}}
| Info5name = [[affiliations (in-universe) |affiliations]]
| Info5details = {{{affiliations|}}}
}}
{{!-}}
{{#if: {{{alias|}}} | 
{{InfoBoxEntry v2.0
| colors = Character
| InfoName = Alais
| InfoDetails = {{{alias}}}
}}
| }}
{{InfoBoxEnd
| name = CharacterInfoBox v2.0
| colors = Character
}}<includeonly>[[Category:{{{name}}}| ]]</includeonly><noinclude>

{{doc}}{{auto-cat2|InfoBox Usage Templates|Character Templates}}</noinclude>

and came out like this Template:InfoBoxBegin v2.0 |-

Template:InfoBoxEnd


Becuase of the way we set up parameters, a user of the characterinfobox only needs to place this in the artilce:

{{CharacterInfoBox v2.0
| name = 
| picture = 
| caption = 
| home_planet =
| role =
| premier_game = 
| affiliations = 
}}

Other info boxes

Template:InfoBox Templates


"{{{1}}}"
— {{{2}}}


References