Difference between revisions of "Help:Infoboxes"

2 bytes added ,  22:09, 7 April 2020
no edit summary
m (Text replace - "v2.5" to "")
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{shortcuts | Usage | {{LW:IB}} }}
{{shortcuts|LW:IB}}


 
Infoboxes are a place to store simple facts related to the article, and putting them in a small, compact table off to the side.  
 
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 ==
== Core of the infobox ==
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
{{InfoboxBegin
| class = {{{class|}}} Fruit  
| class = {{{cass|}}} Fruit  
| title = Fruits
| title = Fruits
| picture = {{{picture|}}}
| picture = {{{picture|}}}
| picture_size = {{{picture_size}}}
| image_size = {{{picture_size}}}
| caption = {{{caption|}}}  
| caption = {{{caption|}}}  
| colors = Wiki
| colors = Wiki
Line 28: Line 26:
}}
}}
{{!-}}
{{!-}}
{{!}} {{InfoBoxEntry
{{!}} {{InfoboxEntry
| colors = Wiki
| colors = Wiki
| InfoName = Pie?
| InfoName = Pie?
| InfoDetails = {{{pie}}}
| InfoDetails = {{{pie}}}
}}
}}
<!-- {{InfoBoxEntry}} -->
<!-- {{InfoboxEntry}} -->
{{!-}}
{{!-}}
{{!}} {{InfoBoxEnd
{{!}} {{InfoboxEnd
| name = WkiInfoBox
| name = WikiInfobox
| colors = Wiki
| colors = Wiki
}} {{tableend}}
}} {{tableend}}
Line 42: Line 40:


comes out looking like:  
comes out looking like:  
{{InfoBoxBegin
{{InfoboxBegin
| class = {{{class|}}} Fruit  
| class = {{{cass|}}} Fruit  
| title = Fruits
| title = Fruits
| picture = {{{picture|}}}
| picture = {{{picture|}}}
| picture_size = {{{picture_size}}}
| image_size = {{{picture_size}}}
| caption = {{{caption|}}}  
| caption = {{{caption|}}}  
| colors = Wiki
| colors = Wiki
Line 62: Line 60:
}}
}}
{{!-}}
{{!-}}
{{!}} {{InfoBoxEntry
{{!}} {{InfoboxEntry
| colors = Wiki
| colors = Wiki
| InfoName = Pie?
| InfoName = Pie?
| InfoDetails = {{{pie}}}
| InfoDetails = {{{pie}}}
}}
}}
<!-- {{InfoBoxEntry}} -->
<!-- {{InfoboxEntry}} -->
{{!-}}
{{!-}}
{{!}} {{InfoBoxEnd
{{!}} {{InfoboxEnd
| name = WkiInfoBox
| name = WikiInfobox
| colors = Wiki
| colors = Wiki
}} {{tableend}}
}} {{tableend}}


Each row in the table has 2 cells: Info#name and Info#details, where # is the row number. [[Template:InfoBoxBegin]] 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]] 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.  


== 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:Infobox vehicle]], 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 actually uses the information. This is where the parameters with a variable 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?


Lets take a look at another example.
Lets take a look at another example.
Line 87: Line 85:


<pre>
<pre>
{{InfoBoxBegin
{{InfoboxBegin
| class = {{{class|}}} Character color5  
| class = {{{cass|}}} Character color5  
| title = Characters
| title = Characters
| picture = {{{picture|}}}
| picture = {{{picture|}}}
| picture_size = {{{picture_size|}}}
| image_size = {{{picture_size|}}}
| caption = {{{caption|}}}  
| caption = {{{caption|}}}  
| colors = Character
| colors = Character
Line 109: Line 107:
{{!-}}
{{!-}}
{{!}} {{#if: {{{alias|}}} |  
{{!}} {{#if: {{{alias|}}} |  
{{InfoBoxEntry
{{InfoboxEntry
| colors = Character
| colors = Character
| InfoName = Alais
| InfoName = Alais
Line 116: Line 114:
| }}
| }}
{{!-}}
{{!-}}
{{!}} {{InfoBoxEntry
{{!}} {{InfoboxEntry
| colors = Character
| colors = Character
| InfoName = Teams
| InfoName = Teams
Line 122: Line 120:
}}
}}
{{!-}}
{{!-}}
{{!}} {{InfoBoxEnd
{{!}} {{InfoboxEnd
| name = CharacterInfoBox
| name = Infobox character
| colors = Character
| colors = Character
}}{{tableend}}<includeonly>[[Category:{{{name}}}| ]]</includeonly><noinclude>
}}{{tableend}}<includeonly>[[Category:{{{name}}}| ]]</includeonly><noinclude>
Line 140: Line 138:




{{doc}}{{auto-cat2|InfoBox Usage Templates|Character Templates}}</noinclude>
{{doc}}{{auto-cat2|Infobox Usage Templates|Character Templates}}</noinclude>
and came out like this  
and came out like this  
{{InfoBoxBegin
{{InfoboxBegin
| class = {{{class|}}} Character color5  
| class = {{{cass|}}} Character color5  
| title = Characters
| title = Characters
| picture = {{{picture|}}}
| picture = {{{picture|}}}
| picture_size = {{{picture_size|}}}
| image_size = {{{picture_size|}}}
| caption = {{{caption|}}}  
| caption = {{{caption|}}}  
| colors = Character
| colors = Character
Line 164: Line 162:
{{!-}}
{{!-}}
{{!}} {{#if: {{{alias|}}} |  
{{!}} {{#if: {{{alias|}}} |  
{{InfoBoxEntry
{{InfoboxEntry
| colors = Character
| colors = Character
| InfoName = Alais
| InfoName = Alais
Line 171: Line 169:
| }}
| }}
{{!-}}
{{!-}}
{{!}} {{InfoBoxEntry
{{!}} {{InfoboxEntry
| colors = Character
| colors = Character
| InfoName = Teams
| InfoName = Teams
Line 177: Line 175:
}}
}}
{{!-}}
{{!-}}
{{!}} {{InfoBoxEnd
{{!}} {{InfoboxEnd
| name = CharacterInfoBox
| name = Infobox character
| colors = Character
| colors = Character
}}{{tableend}}
}}{{tableend}}
Line 186: Line 184:


<pre>
<pre>
{{CharacterInfoBox
{{Infobox character
| picture =  
| picture =  
| caption =  
| caption =  
Line 199: Line 197:


== Other info boxes ==
== Other info boxes ==
{{InfoBox Templates}}
{{Main|Lylat Wiki:Templates#Infobox templates}}




8,161

edits