Fandom

Community Central

Comments3

Part 6. Contributing to a Wiki: Making Infoboxes (Templates)

2Actimv September 5, 2013 User blog:2Actimv

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Wikia Blog logo text 002
Making Infoboxes is hard. It's much coding and not everybody know how to do it. Below you can find some codes.

Make a standard Infobox

Below you can see the code you have to paste in a template page. In this infobox you have to copy/paste also always the questions.

{| class="infobox" style="font-size:89%; width:300px; background-color:#FFF;"
|-
! colspan="2" style="background-color:#3366CC; color:#FFFFFF; font-size:120%; padding:1em;" | {{{Box title|No Title}}}
{{#if: {{{image|}}}|
{{!}}-
{{!}} colspan="2" style="text-align:center;" {{!}} [[{{{image}}}|{{{imagewidth|250}}}px]]<br/>''{{{caption| }}}''
|
}}
|-
| style="width:30%;" |
'''{{{Row 1 title|No Title}}}'''
| style="width:70%;" |
{{{Row 1 info|No information}}}
{{#if: {{{Row 2 title|}}}|
{{!}}-
{{!}}
'''{{{Row 2 title}}}'''
{{!}}
{{{Row 2 info|No information}}}
{{#if: {{{Row 3 title|}}}|
{{!}}-
{{!}}
'''{{{Row 3 title}}}'''
{{!}}
{{{Row 3 info|No information}}}
{{#if: {{{Row 4 title|}}}|
{{!}}-
{{!}}
'''{{{Row 4 title}}}'''
{{!}}
{{{Row 4 info|No information}}}
{{#if: {{{Row 5 title|}}}|
{{!}}-
{{!}}
'''{{{Row 5 title}}}'''
{{!}}
{{{Row 5 info|No information}}}
{{#if: {{{Row 6 title|}}}|
{{!}}-
{{!}}
'''{{{Row 6 title}}}'''
{{!}}
{{{Row 6 info|No information}}}
{{#if: {{{Row 7 title|}}}|
{{!}}-
{{!}}
'''{{{Row 7 title}}}'''
{{!}}
{{{Row 7 info|No information}}}
{{#if: {{{Row 8 title|}}}|
{{!}}-
{{!}}
'''{{{Row 8 title}}}'''
{{!}}
{{{Row 8 info|No information}}}
{{#if: {{{Row 9 title|}}}|
{{!}}-
{{!}}
'''{{{Row 9 title}}}'''
{{!}}
{{{Row 9 info|No information}}}
{{#if: {{{Row 10 title|}}}|
{{!}}-
{{!}}
'''{{{Row 10 title}}}'''
{{!}}
{{{Row 10 info|No information}}}
{{#if: {{{Row 11 title|}}}|
{{!}}-
{{!}} colspan="2" style="text-align:center; background:#AAAAAA;" {{!}}
'''Too many parameters'''
|
}}
|
}}
|
}}
|
}}
|
}}
|
}}
|
}}
|
}}
|
}}
|
}}
|}<noinclude><br style="clear:both;"/>
{{documentation}}</noinclude>

After pasting this in a template page you have to add the following code in the page with the same name with behind the letters "/doc".

==Description==
*This template produces a [[Help:Infobox|infobox]]-style template.
*You may want to copy and modify this to create a specific infobox (e.g. character infobox).
*This template requires [[Help:Parser functions|parser functions]] to be enabled (Wikia default: on).

==Syntax==
<pre>
{{infobox name
|Box title    = 
|image        = Image:Example.jpg
|imagewidth   = [defaults to 250]
|caption      = Bob the Flower
|Row 1 title  =
|Row 1 info   =
|Row 2 title  =
|Row 2 info   =
|Row 3 title  =
|Row 3 info   =
|Row 4 title  =
|Row 4 info   =
|Row 5 title  =
|Row 5 info   =
|Row 6 title  =
|Row 6 info   =
|Row 7 title  =
|Row 7 info   =
|Row 8 title  =
|Row 8 info   =
|Row 9 title  =
|Row 9 info   =
|Row 10 title =
|Row 10 info  =
}}
<pre>

==Usage==
{{Infobox
|Box title    = Info Title
|image        = Image:Example.jpg
|imagewidth   = 120
|caption      = A flower
|Row 1 title  = Title row 1
|Row 1 info   = Info row 1
|Row 2 title  = Title row 2
|Row 2 info   = Info row 2
|Row 3 title  = Title row 3
|Row 3 info   = Info row 3
|Row 4 title  = Title row 4
|Row 4 info   = Info row 4
|Row 5 title  = Title row 5
|Row 5 info   = Info row 5
|Row 6 title  = Title row 6
|Row 6 info   = Info row 6
|Row 7 title  = Title row 7
|Row 7 info   = Info row 7
|Row 8 title  = Title row 8
|Row 8 info   = Info row 8
|Row 9 title  = Title row 9
|Row 9 info   = Info row 9
|Row 10 title = Title row 10
|Row 10 info  = Info row 10
}}

<includeonly>[[Category:General wiki templates|{{PAGENAME}}]][[Category:Infobox templates| ]]</includeonly><noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude>

Now you can use this infobox on every page on your wiki.

Making a customized Infobox

Below you can find the code of the customized infobox. You have to change the title texts, others he's not customized. You add also this template in an other template page.

{| class="infobox" style="font-size:89%; width:300px; background-color:#FFF;"
|-
! class="color1" colspan="2" style="font-size:120%; padding:1em;" | {{{name|{{PAGENAME}}}}}
|-
{{#if: {{{image|}}}|
{{!}}-
{{!}} colspan="2" style="text-align:center;" {{!}} [[File:{{PAGENAME:{{{image}}}}}|{{{imagewidth|300}}}px]]<br/>''{{{caption| }}}''
|
}}
|-
! class="color1" colspan="2" | {{{title|}}}
|-
{{#if: {{{title1|}}}|
{{!}}-
{{!}}
'''title1'''
{{!}}
{{{title1}}}
{{!}}-
}}
{{#if: {{{title2|}}}|
{{!}}-
{{!}}
'''title2'''
{{!}}
{{{title2}}}
{{!}}-
}}
{{#if: {{{title3|}}}|
{{!}}-
{{!}}
'''title3'''
{{!}}
{{{title3}}}
{{!}}-
}}
{{#if: {{{title4|}}}|
{{!}}-
{{!}}
'''title4'''
{{!}}
{{{title4}}}
{{!}}-
}}
{{#if: {{{title5|}}}|
{{!}}-
{{!}}
'''title5'''
{{!}}
{{{title5}}}
{{!}}-
}}
{{#if: {{{title6|}}}|
{{!}}-
{{!}}
'''title6'''
{{!}}
{{{title6}}}
{{!}}-
}}
{{#if: {{{title7|}}}|
{{!}}-
{{!}}
'''title7'''
{{!}}
{{{title7}}}
{{!}}-
}}
{{#if: {{{title8|}}}|
{{!}}-
{{!}}
'''title8'''
{{!}}
{{{title8}}}
{{!}}-
}}
{{#if: {{{title9|}}}|
{{!}}-
{{!}}
'''title9'''
{{!}}
{{{title9}}}
{{!}}-
}}
{{#if: {{{title10|}}}|
{{!}}-
{{!}}
'''title10'''
{{!}}
{{{title10}}}
{{!}}-
}}
{{#if: {{{title11|}}}|
{{!}}-
{{!}}
'''title11'''
{{!}}
{{{title11}}}
{{!}}-
|}
|}<noinclude>
{{clr}}{{Documentation}}
</noinclude>

Copy/Paste the following code in the template page with the same name with behind the extra letters "/doc".

==Usage==
{{Infobox name
|name= name
|image= Placeholder location.png
|title= title
|title1= answer1
|title2= answer2 
|title3= answer3 
|title4= answer4
|title5= answer5
|title6= answer6
|title7= answer7
|title8= answer8
|title9= answer9
|title10= answer10
|title11= answer11 
}}

Use <pre> for the viewing of the code on the page you'll create with this code.

Now you can use this code on every page on your wiki.

If you've got problems with it, please let me now in a comment, I'll help you with it!

If you have questions about infoboxes or want to customize infoboxes please go to my message wall to ask me about it. You can also ask an admin on the wiki, go to the forums or ask in the chat.

2Actimv's Help Blog
≤ Previous Next ≥

Also on Fandom

Random Wiki