FANDOM


(Highlights)
(promoting to Community Highlights)
 
(13 intermediate revisions by one user not shown)
Line 1: Line 1:
 
{{Blogs by Thisismyrofl}}
 
{{Blogs by Thisismyrofl}}
 
{{Infobox Wolf3D level
 
{{Infobox Wolf3D level
| title = Episode 1, Floor 1
+
| title = Episode 1, Floor 1
| image = E1M1 Screenshot.png
+
| image = E1M1 Screenshot.png
| imagecaption = The level opens on the body of a dead Guard.
+
| imagecaption = The level opens on the body of a dead Guard.
| crosses = 8
+
| crosses = 8
| chalices = 7
+
| chalices = 7
| chests = 7
+
| chests = 7
| par = 1:30
+
| par = 1:30
| song = "Get Them"
+
| song = "Get Them"
| secrets = 5
+
| secrets = 5
}}Hey! This is [[User:Thisismyrofl|Thisismyrofl]], an admin here on Community Central. I wanted to see if I could explain how to use the ''new'' style of [[Template:Infobox]] (new as in September 2012). On your left, you see a basic infobox made in the new infobox format. We'll learn how to make an infobox of our own to meet our specific needs!
+
| previouslevel = None
  +
| nextlevel = Episode 1, Floor 2
  +
}}Hey! This is [[User:Thisismyrofl|Thisismyrofl]], an admin here on Community Central. I wanted to see if I could explain how to use the ''new'' style of [[Template:Infobox]] (new as in September 2012). On your right, you see a basic infobox made in the new infobox format. We'll learn how to make an infobox of our own to meet our specific needs!
   
I'm referring here to the ''default'' styles, that is, those that were on the [[c:starter:Template:Infobox|Starter Pages Wiki's '''Template:Infobox''' page]]. Since every newly created wiki, at the time of its creation, is given a copy of every page and template on Starter Pages Wiki, that means that there are thousands of wikis that came with the ''old'' style, and thousands founded after September 2012 that came with the ''new'' style.
+
I'm referring here to the ''default'' styles, that is, those that were on the [[c:starter:Template:Infobox|Starter Pages Wiki's '''Template:Infobox''' page]]. Since every newly created wiki, at the time of its creation, is given a copy of every page and template on Starter Pages Wiki, that means that there are thousands of wikis that came with the ''old'' style, and thousands founded after October 2015 that came with the ''new'' style.
  +
  +
For more information on old and new styles of infoboxes, see [[User blog:Thisismyrofl/Infoboxes old and new|my other blog.]]
   
 
== Plan the infobox ==
 
== Plan the infobox ==
Line 25: Line 25:
 
* Image caption
 
* Image caption
 
* Heading: "Treasure"
 
* Heading: "Treasure"
** Number of crosses (default: "0")
+
** Crosses (default: "0")
** Number of chalices (default: "0")
+
** Chalices (default: "0")
** Number of chests (default: "0")
+
** Chests (default: "0")
 
* Heading: "Other stats"
 
* Heading: "Other stats"
** Par time (default: hidden)
+
** Par time (default: hidden)
** Song that plays (default: hidden)
+
** Song (default: hidden)
** Number of secrets (default: hidden)
+
** Secrets (default: hidden)
  +
* Heading: "Level order"
  +
** Previous level and Next Level (side by side)
 
</pre>
 
</pre>
   
Line 42: Line 42:
 
<pre>
 
<pre>
 
{{Infobox Wolf3D level
 
{{Infobox Wolf3D level
| title =
+
| title =
| image =
+
| image =
| imagewidth =
+
| imagecaption =
| imagecaption =
+
| crosses =
| crosses =
+
| chalices =
| chalices =
+
| chests =
| chests =
+
| par =
| par =
+
| song =
| song =
+
| secrets =
| secrets =
+
| previouslevel =
  +
| nextlevel =
 
}}
 
}}
   
Line 63: Line 63:
 
Let's take a look at the standard code of [[:Template:Infobox]]. Remember that this is the ''default'' code, and not necessarily the code that will be seen on your infobox. I've colored it myself for clarity - you're not likely to see this kind of coloring when you actually edit.
 
Let's take a look at the standard code of [[:Template:Infobox]]. Remember that this is the ''default'' code, and not necessarily the code that will be seen on your infobox. I've colored it myself for clarity - you're not likely to see this kind of coloring when you actually edit.
   
{{Thisismyrofl-infobox-explain}}
+
{{Thisismyrofl-new-infobox-explain}}
   
 
=== Visibility ===
 
=== Visibility ===
 
There are two types of infobox rows: those with default values and those which are hidden if no value is given. By default, the first three have default values, and the fourth, fifth, and sixth are hidden.
 
There are two types of infobox rows: those with default values and those which are hidden if no value is given. By default, the first three have default values, and the fourth, fifth, and sixth are hidden.
   
Below, two infoboxes: on the right, I have filled in the template entirely, but on the left I have left all six fields blank. Because they're blank, the first three return the default value "''Unknown''". The fourth, fifth, and sixth are differently coded: when no value is specified, they do not appear at all. Keep this difference in mind.
+
Below, two infoboxes: on the right, I have filled in the template entirely, but on the left I have left all six fields blank. Because they're blank, the first three return the default value "''Unknown''". The fourth, fifth, and sixth, as well as "Previous" and "Next" are differently coded: when no value is specified, they do not appear at all. Keep this difference in mind.
   
 
{| style="background:transparent; border:transparent; margin-left:auto; margin-right:auto;"
 
{| style="background:transparent; border:transparent; margin-left:auto; margin-right:auto;"
Line 90: Line 90:
 
| fifth = Hoo
 
| fifth = Hoo
 
| sixth = Hum
 
| sixth = Hum
  +
| previous = Aha
  +
| next = Ooh
 
}}
 
}}
 
|}
 
|}
Line 98: Line 100:
 
'''DON'T CHANGE THE PAGE [[Template:Infobox]]! You're supposed to leave it unchanged and edit ''other'' infobox templates, which you can copy from Template:Infobox.'''
 
'''DON'T CHANGE THE PAGE [[Template:Infobox]]! You're supposed to leave it unchanged and edit ''other'' infobox templates, which you can copy from Template:Infobox.'''
   
I'll assume that at this point, you already have an infobox or infobox template at the location '''"Infobox Wolf3D level" on ''your'' wiki'''<ref group="footnotes" name="cantfind" />, or whatever you've decided to name it. If you haven't, take a look at my other blog: [[User blog:Thisismyrofl/Creating a new-style infobox]].
+
I'll assume that at this point, you already have an infobox or infobox template at the location '''"Infobox Wolf3D level" on ''your'' wiki'''<ref group="footnotes" name="cantfind" />, or whatever you've decided to name it. If you haven't, take a look at my other blog: [[User blog:Thisismyrofl/Creating a portable new-style infobox]].
   
 
Any part of this can be modified, but look at the {{Color|green|green}}, {{Color|red|red}}, and {{Color|blue|blue}} parts. Those are the important parts we need to work with. Until your abilities with templates have improved, it's best to leave the {{Color|purple|purple}} and {{Color|orange|orange}} parts alone.
 
Any part of this can be modified, but look at the {{Color|green|green}}, {{Color|red|red}}, and {{Color|blue|blue}} parts. Those are the important parts we need to work with. Until your abilities with templates have improved, it's best to leave the {{Color|purple|purple}} and {{Color|orange|orange}} parts alone.
   
 
=== Editing headings ===
 
=== Editing headings ===
:''[http://community.wikia.com/wiki/Template:Infobox_Wolf3D_level?diff=1671761&oldid=1671740 Click here to see how I did it!]''
+
:''[http://community.wikia.com/wiki/Template:Infobox_Wolf3D_level?diff=1671828&oldid=1671810 Click here to see how I did it!]''
By default, the infobox has two heading snippets, highlighted in green in my above code. Their default texts are "some attributes" and "other attributes".
+
By default, the infobox has three heading snippets, highlighted in green in my above code. Their default texts are "some attributes", "other attributes", and "Order".
 
<poem style="font-family:monospace; color:green;">
 
<poem style="font-family:monospace; color:green;">
 
<header><span style="color:green;background:yellow;">Some attributes</span></header>
 
<header><span style="color:green;background:yellow;">Some attributes</span></header>
Line 116: Line 118:
 
<header><span style="color:green;background:yellow;">Order</span></header>
 
<header><span style="color:green;background:yellow;">Order</span></header>
 
</poem>
 
</poem>
The default texts aren't really specific enough for a lot of wikis. Just change the text "Some attributes" and "Other attributes" (highlighted here in <span style="color:green;background:yellow;">yellow</span>) to your liking! You can leave the rest of the code intact.
+
The default texts aren't really specific enough for a lot of wikis. Just change the text "Some attributes", "Other attributes", and "Order" (highlighted here in <span style="color:green;background:yellow;">yellow</span>) to your liking! You can leave the rest of the code intact.
   
As always, you can remove either or both of the headings if you want (just delete any code that looks like the above heading) or add headings (just paste in a copy of the above code).
+
As always, you can remove either or both of the headings if you want (just delete any code that looks like the above headings) or add headings (just paste in a copy of the above code).
   
 
=== Editing rows with defaults ===
 
=== Editing rows with defaults ===
:''[http://community.wikia.com/wiki/Template:Infobox_Wolf3D_level?diff=1671764&oldid=1671761 Click here to see how I did it!]''
+
:''[http://community.wikia.com/wiki/Template:Infobox_Wolf3D_level?diff=1671831&oldid=1671828 Click here to see how I did it!]''
By default, the infobox has six rows, the first three of which have the property that when a parameter is undefined, the row still shows - showing instead a default text.
+
By default, the infobox has six rows, the first three of which have the property that when a parameter is undefined, the row is still visible - showing instead a default text.
 
<poem style="font-family:monospace; color:red;">
 
<poem style="font-family:monospace; color:red;">
<data source="<span style="background:yellowgreen;color:red;">first</span>"><label><span style="background:cyan;color:red;">First</span></label><default><span style="color:red;background:yellow;">''Unknown''</span></default></data>
+
<data source="<span style="background:yellowgreen;color:red;">first</span>"><label><span style="background:cyan;color:red;">First</span></label><default><span style="color:red;background:yellow;">'<nowiki/>'Unknown'<nowiki/>'</span></default></data>
<data source="<span style="background:yellowgreen;color:red;">second</span>"><label><span style="background:cyan;color:red;">Second</span></label><default><span style="color:red;background:yellow;">''Unknown''</span></default></data>
+
<data source="<span style="background:yellowgreen;color:red;">second</span>"><label><span style="background:cyan;color:red;">Second</span></label><default><span style="color:red;background:yellow;">'<nowiki/>'Unknown'<nowiki/>'</span></default></data>
<data source="<span style="background:yellowgreen;color:red;">third</span>"><label><span style="background:cyan;color:red;">Third</span></label><default><span style="color:red;background:yellow;">''Unknown''</span></default></data>
+
<data source="<span style="background:yellowgreen;color:red;">third</span>"><label><span style="background:cyan;color:red;">Third</span></label><default><span style="color:red;background:yellow;">'<nowiki/>'Unknown'<nowiki/>'</span></default></data>
 
</poem>
 
</poem>
   
 
Each of these three obvious snippets is a row, but the default headings ("first", "second", "third") don't work for a lot of people. So we can feel free to change them! I've highlighted the bits of code you'd edit.
 
Each of these three obvious snippets is a row, but the default headings ("first", "second", "third") don't work for a lot of people. So we can feel free to change them! I've highlighted the bits of code you'd edit.
 
# Change the label text (here highlighted in <span style="background:cyan;color:red;">cyan</span>) to read whatever you want to appear on the left side of the infobox row.
 
# Change the label text (here highlighted in <span style="background:cyan;color:red;">cyan</span>) to read whatever you want to appear on the left side of the infobox row.
# Change the parameter name (here highlighted in <span style="background:yellowgreen;color:red;">green</span>) to display the parameter name you decided on in your [[#Default syntax|default syntax earlier]]. For example, my first parameter was to be "crosses", so I'd type <code><nowiki>{{{crosses|...}}}</nowiki></code> where the ellipsis ("...") stands for the default text - see the next step.
+
# Change the parameter name (here highlighted in <span style="background:yellowgreen;color:red;">green</span>) to display the parameter name you decided on in your [[#Default syntax|default syntax earlier]]. For example, my first parameter was to be "crosses", so I'd replace "first" with "crosses".
# Change the default text (highlighted in <span style="color:red;background:yellow;">yellow</span>) if you want. The default action is that an unspecified parameter will display the code <code><nowiki>''Unknown''</nowiki></code> which returns an italicized: "''Unknown''". You can change the default text to whatever you want, and format it with italics, without italics, or otherwise. For example, my default number of crosses was to be "0". So, combined with the parameter name from earlier, I'd type <code><nowiki>{{{crosses|0}}}</nowiki></code>
+
# Change the default text (highlighted in <span style="color:red;background:yellow;">yellow</span>) if you want. The default action is that an unspecified parameter will display the code <code><nowiki>''Unknown''</nowiki></code> which returns an italicized: "''Unknown''". You can change the default text to whatever you want, and format it with italics, without italics, or otherwise. For example, my default number of crosses was to be "0". So, I would replace the <code><nowiki>''Unknown''</nowiki></code> with <code>0</code>.
 
# I've highlighted and explained how to edit the "First" row, but you can follow the same steps for the second and third.
 
# I've highlighted and explained how to edit the "First" row, but you can follow the same steps for the second and third.
   
As always, remember that you can remove one, two, or all three of the above snippets of code in order to use ''fewer'' rows with defaults (perhaps if you want all your rows to be hidden), or you can add your own.
+
As always, remember that you can remove one, two, or all three of the above rows in order to use ''fewer'' rows with defaults (perhaps if you want all your rows to be hidden), or you can add your own.
   
 
=== Editing rows that hide ===
 
=== Editing rows that hide ===
:''[http://community.wikia.com/wiki/Template:Infobox_Wolf3D_level?diff=1671767&oldid=1671764 Click here to see how I did it!]''
+
:''[http://community.wikia.com/wiki/Template:Infobox_Wolf3D_level?diff=1671833&oldid=1671831 Click here to see how I did it!]''
By default, the infobox has six rows, the fourth, fifth, and sixth of which have the property that when a parameter is undefined, the row does not appear at all. Contrast with the above behavior.
+
By default, the infobox has six rows, the fourth, fifth, and sixth of which have the property that when a parameter is undefined, the row does not appear at all. Contrast with the above behavior, where the row remains visible.
 
<poem style="font-family:monospace; color:blue;">
 
<poem style="font-family:monospace; color:blue;">
 
<data source="<span style="background:yellowgreen;color:blue;">fourth</span>"><label><span style="background:cyan;color:blue;">Fourth</span></label></data>
 
<data source="<span style="background:yellowgreen;color:blue;">fourth</span>"><label><span style="background:cyan;color:blue;">Fourth</span></label></data>
Line 146: Line 148:
 
</poem>
 
</poem>
   
Each of these three obvious snippets is a row, but the default headings ("fourth", "fifth", "sixth") don't work for a lot of people. So we can feel free to change them! I've highlighted the bits of code you'd edit.
+
Each of these rows is a row of the infobox, but the default headings ("fourth", "fifth", "sixth") don't work for a lot of people. So we can feel free to change them! I've highlighted the bits of code you'd edit.
# Change the header text (here highlighted in <span style="background:cyan;color:blue;">cyan</span>) to read whatever you want to appear on the left side of the infobox row.
+
# Change the label text (here highlighted in <span style="background:cyan;color:blue;">cyan</span>) to read whatever you want to appear on the left side of the infobox row.
# Change the parameter name (here highlighted in <span style="background:yellowgreen;color:blue;">green</span>) to display the parameter name you decided on in your [[#Default syntax|default syntax earlier]]. For example, my first parameter which I wanted to be hidden was to be "par", so I'd type <code><nowiki>{{{par|}}}</nowiki></code> in the first spot and <code><nowiki>{{{par}}}</nowiki></code> in the second. (It makes a difference!)
+
# Change the parameter name (here highlighted in <span style="background:yellowgreen;color:blue;">green</span>) to display the parameter name you decided on in your [[#Default syntax|default syntax earlier]]. For example, my first parameter which I wanted to be hidden was to be "par", so I'd type <code>par</code> in place of <code>fourth</code>.
 
# I've highlighted and explained how to edit the "Fourth" row, but you can follow the same steps for "Fifth" and "Sixth".
 
# I've highlighted and explained how to edit the "Fourth" row, but you can follow the same steps for "Fifth" and "Sixth".
   
 
As always, remember that you can remove one, two, or all three of the above snippets of code in order to use ''fewer'' rows with default action to hide, or you can add your own.
 
As always, remember that you can remove one, two, or all three of the above snippets of code in order to use ''fewer'' rows with default action to hide, or you can add your own.
  +
  +
=== Editing order rows ===
  +
:''[http://community.wikia.com/wiki/Template:Infobox_Wolf3D_level?diff=1671847&oldid=1671834 Click here to see how I did it!]''
  +
The infobox also comes with two parameters meant to appear side-by-side. If omitted, they remain invisible (much like the fourth, fifth, and sixth parameters).
  +
<poem style="font-family:monospace; color:cyan;">
  +
<data source="<span style="background:yellowgreen;color:blue;">previous</span>"><label><span style="background:cyan;color:blue;">Previous</span></label></data>
  +
<data source="<span style="background:yellowgreen;color:blue;">next</span>"><label><span style="background:cyan;color:blue;">Next</span></label></data>
  +
</poem>
  +
  +
These parameters display side-by-side because of the <code>layout="horizontal"</code> in the <group> tag.
  +
# Change the label text (here highlighted in <span style="background:cyan;color:blue;">cyan</span>) to read whatever you want to appear on the left side of the infobox row.
  +
# Change the parameter name (here highlighted in <span style="background:yellowgreen;color:blue;">green</span>) to display the parameter name you decided on in your [[#Default syntax|default syntax earlier]]. For example, my first parameter which I wanted to be hidden was to be "par", so I'd type <code>par</code> in place of <code>fourth</code>.
  +
  +
As always, remember that you can remove the above snippets of code in order to use ''fewer'' rows with default action to hide, or you can add your own.
   
 
== We're mostly done! ==
 
== We're mostly done! ==
Line 160: Line 176:
   
 
=== Default title ===
 
=== Default title ===
:''[http://community.wikia.com/wiki/Template:Infobox_Wolf3D_level?diff=1671768&oldid=1671767 Click here to see how I did it!]''
+
:''[http://community.wikia.com/wiki/Template:Infobox_Wolf3D_level?diff=1671834&oldid=1671833 Click here to see how I did it!]''
 
The <code>|title=</code> parameter controls what appears at the top of the infobox, in the fourth row of the code.
 
The <code>|title=</code> parameter controls what appears at the top of the infobox, in the fourth row of the code.
 
<poem style="color:purple;font-family:monospace;">
 
<poem style="color:purple;font-family:monospace;">
<title source="title"><default>''Unknown''</default></title>
+
<title source="title"><default>'<nowiki/>'Unknown'<nowiki/>'</default></title>
 
</poem>
 
</poem>
By default, you have to fill it in, otherwise your infobox will have a nasty italicized "''Unknown''" at the top. A smarter behavior can be brought about by switching in a <code><nowiki>{{PAGENAME}}</nowiki></code> [[Help:Magic words|magic word]]:
+
By default, you have to fill it in, otherwise your infobox will have a nasty italicized "''Unknown''" at the top. A smarter behavior can be brought about by switching in a <code><nowiki>{{PAGENAME}<nowiki/>}</nowiki></code> [[Help:Magic words|magic word]]:
 
<poem style="color:purple;font-family:monospace;">
 
<poem style="color:purple;font-family:monospace;">
<title source="title"><default>{{PAGENAME}}</default></title>
+
<title source="title"><default>{{PAGENAME}<nowiki/>}</default></title>
 
</poem>
 
</poem>
 
Now, if the title is left blank, it'll default to the name of the page. You might still have to edit the <code>|title=</code> parameter on some pages.
 
Now, if the title is left blank, it'll default to the name of the page. You might still have to edit the <code>|title=</code> parameter on some pages.
Line 182: Line 198:
 
| title =
 
| title =
 
| image =
 
| image =
| imagewidth =
 
 
| imagecaption =
 
| imagecaption =
 
| crosses =
 
| crosses =
Line 190: Line 205:
 
| song =
 
| song =
 
| secrets =
 
| secrets =
  +
| previouslevel =
  +
| nextlevel =
 
}}
 
}}
 
&lt;/pre>
 
&lt;/pre>
Line 200: Line 217:
 
=== Be bold! ===
 
=== Be bold! ===
 
I've only outlined the basics of editing infoboxes. Feel free to '''be bold''' and try editing them further! If you mess up, you can always undo the edits from the page's [[Help:history|history]].
 
I've only outlined the basics of editing infoboxes. Feel free to '''be bold''' and try editing them further! If you mess up, you can always undo the edits from the page's [[Help:history|history]].
  +
  +
And always feel free to ask someone for help if you need it!
  +
  +
And I would love it if you would [[Message wall:Thisismyrofl|send me a message]] if my blogs helped you!
   
 
== Notes ==
 
== Notes ==
Line 210: Line 231:
 
== See also ==
 
== See also ==
 
* [[Help:Infobox]]
 
* [[Help:Infobox]]
* [[User blog:Thisismyrofl/Infoboxes old and new]]
+
* [[User blog:Thisismyrofl/Infoboxes portable, old, and new]]
* [[User blog:Thisismyrofl/Creating a new-style infobox]]
+
* [[User blog:Thisismyrofl/Creating a portable new-style infobox]]
* [[User blog:Rappy 4187/Guide to Infoboxes]]
 
 
 
[[Category:Blog posts]]
 
[[Category:Blog posts]]
  +
[[Category:Community Highlights]]

Latest revision as of 19:12, December 7, 2015

150px-1330470.png Other blogs by Thisismyrofl
Infoboxes
Suggestions


Hey! This is Thisismyrofl, an admin here on Community Central. I wanted to see if I could explain how to use the new style of Template:Infobox (new as in September 2012). On your right, you see a basic infobox made in the new infobox format. We'll learn how to make an infobox of our own to meet our specific needs!

I'm referring here to the default styles, that is, those that were on the Starter Pages Wiki's Template:Infobox page. Since every newly created wiki, at the time of its creation, is given a copy of every page and template on Starter Pages Wiki, that means that there are thousands of wikis that came with the old style, and thousands founded after October 2015 that came with the new style.

For more information on old and new styles of infoboxes, see my other blog.

Plan the infobox Edit

Let's make a plan! Think about what you want your infobox to look like, and decide about visibility. It might help to write down your plan on a piece of paper, or type it somewhere.

If I wanted to make a template "Template:Infobox Wolf3D level" for the game Wolfenstein 3D, it might follow this format:

Template:Infobox Wolf3D level
* Title
* Image
* Image caption
*  Heading: "Treasure"
** Crosses				(default: "0")
** Chalices				(default: "0")
** Chests				(default: "0")
* Heading: "Other stats"
** Par time				(default: hidden)
** Song					(default: hidden)
** Secrets				(default: hidden)
* Heading: "Level order"
** Previous level and Next Level	(side by side)

If a row is left empty when the template is called, we must decide whether it should give a default value (such as "Unknown") or be hidden (that is, the row won't show up at all). Jump to the section #Visibility for more information. Mark on your plan how you want each row to be treated.

Default syntax Edit

Let's also make the default syntax for the new template! This can be copied into the template's documentation. It should look something like this.

{{Infobox Wolf3D level
| title         = 
| image         = 
| imagecaption  = 
| crosses       = 
| chalices      = 
| chests        = 
| par           = 
| song          = 
| secrets       = 
| previouslevel = 
| nextlevel     = 
}}

This is what will be pasted into an article and then filled out to make a fully-fledged infobox appear on the article! But before it works, you need to customize the page "Infobox Wolf3D level" on your wiki. Try not to be excessive in naming the parameters: lowercase, typed as one word is sufficient, because it doesn't affect the appearance of the infobox anyway.

Now that we've planned it out, let's customize our infobox.

Understanding the code Edit

Let's take a look at the standard code of Template:Infobox. Remember that this is the default code, and not necessarily the code that will be seen on your infobox. I've colored it myself for clarity - you're not likely to see this kind of coloring when you actually edit.

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
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.


Visibility Edit

There are two types of infobox rows: those with default values and those which are hidden if no value is given. By default, the first three have default values, and the fourth, fifth, and sixth are hidden.

Below, two infoboxes: on the right, I have filled in the template entirely, but on the left I have left all six fields blank. Because they're blank, the first three return the default value "Unknown". The fourth, fifth, and sixth, as well as "Previous" and "Next" are differently coded: when no value is specified, they do not appear at all. Keep this difference in mind.


Edit your infobox! Edit

DON'T CHANGE THE PAGE Template:Infobox! You're supposed to leave it unchanged and edit other infobox templates, which you can copy from Template:Infobox.

I'll assume that at this point, you already have an infobox or infobox template at the location "Infobox Wolf3D level" on your wiki[footnotes 1], or whatever you've decided to name it. If you haven't, take a look at my other blog: User blog:Thisismyrofl/Creating a portable new-style infobox.

Any part of this can be modified, but look at the green, red, and blue parts. Those are the important parts we need to work with. Until your abilities with templates have improved, it's best to leave the purple and orange parts alone.

Editing headings Edit

Click here to see how I did it!

By default, the infobox has three heading snippets, highlighted in green in my above code. Their default texts are "some attributes", "other attributes", and "Order".

<header>Some attributes</header>

...

<header>Other attributes</header>

...

<header>Order</header>

The default texts aren't really specific enough for a lot of wikis. Just change the text "Some attributes", "Other attributes", and "Order" (highlighted here in yellow) to your liking! You can leave the rest of the code intact.

As always, you can remove either or both of the headings if you want (just delete any code that looks like the above headings) or add headings (just paste in a copy of the above code).

Editing rows with defaults Edit

Click here to see how I did it!

By default, the infobox has six rows, the first three of which have the property that when a parameter is undefined, the row is still visible - showing instead a default text.

<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>

Each of these three obvious snippets is a row, but the default headings ("first", "second", "third") don't work for a lot of people. So we can feel free to change them! I've highlighted the bits of code you'd edit.

  1. Change the label text (here highlighted in cyan) to read whatever you want to appear on the left side of the infobox row.
  2. Change the parameter name (here highlighted in green) to display the parameter name you decided on in your default syntax earlier. For example, my first parameter was to be "crosses", so I'd replace "first" with "crosses".
  3. Change the default text (highlighted in yellow) if you want. The default action is that an unspecified parameter will display the code ''Unknown'' which returns an italicized: "Unknown". You can change the default text to whatever you want, and format it with italics, without italics, or otherwise. For example, my default number of crosses was to be "0". So, I would replace the ''Unknown'' with 0.
  4. I've highlighted and explained how to edit the "First" row, but you can follow the same steps for the second and third.

As always, remember that you can remove one, two, or all three of the above rows in order to use fewer rows with defaults (perhaps if you want all your rows to be hidden), or you can add your own.

Editing rows that hide Edit

Click here to see how I did it!

By default, the infobox has six rows, the fourth, fifth, and sixth of which have the property that when a parameter is undefined, the row does not appear at all. Contrast with the above behavior, where the row remains visible.

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

Each of these rows is a row of the infobox, but the default headings ("fourth", "fifth", "sixth") don't work for a lot of people. So we can feel free to change them! I've highlighted the bits of code you'd edit.

  1. Change the label text (here highlighted in cyan) to read whatever you want to appear on the left side of the infobox row.
  2. Change the parameter name (here highlighted in green) to display the parameter name you decided on in your default syntax earlier. For example, my first parameter which I wanted to be hidden was to be "par", so I'd type par in place of fourth.
  3. I've highlighted and explained how to edit the "Fourth" row, but you can follow the same steps for "Fifth" and "Sixth".

As always, remember that you can remove one, two, or all three of the above snippets of code in order to use fewer rows with default action to hide, or you can add your own.

Editing order rows Edit

Click here to see how I did it!

The infobox also comes with two parameters meant to appear side-by-side. If omitted, they remain invisible (much like the fourth, fifth, and sixth parameters).

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

These parameters display side-by-side because of the layout="horizontal" in the <group> tag.

  1. Change the label text (here highlighted in cyan) to read whatever you want to appear on the left side of the infobox row.
  2. Change the parameter name (here highlighted in green) to display the parameter name you decided on in your default syntax earlier. For example, my first parameter which I wanted to be hidden was to be "par", so I'd type par in place of fourth.

As always, remember that you can remove the above snippets of code in order to use fewer rows with default action to hide, or you can add your own.

We're mostly done! Edit

Now you can save the page! Enjoy your new infobox! Paste your default syntax into an article and fill it in. The infobox I made looks like the one on the right. Super pretty!

Finishing touches Edit

The above steps are the important part, which is why I had you save the page. There's a few other things that we can do, but your template will function fine without them.

Default title Edit

Click here to see how I did it!

The |title= parameter controls what appears at the top of the infobox, in the fourth row of the code.

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

By default, you have to fill it in, otherwise your infobox will have a nasty italicized "Unknown" at the top. A smarter behavior can be brought about by switching in a {{PAGENAME}<nowiki/>} magic word:

<title source="title"><default>{{PAGENAME}}</default></title>

Now, if the title is left blank, it'll default to the name of the page. You might still have to edit the |title= parameter on some pages.

Documentation Edit

Templates are kinda complicated, so it's best to have a little snippet of information on how to use it at the bottom of the template. You'll notice that at the bottom of the default template code, there's a {{Documentation}} template call. This calls Template:Documentation, which varies from wiki to wiki, but in any case, it will transclude the page located at Template:Your template/doc.

Here's a wise layout for your new template's documentation:

== Default syntax==
Paste this into the page, then fill it in, to use the template.
<pre>
{{Infobox Wolf3D level
| title         = 
| image         = 
| imagecaption  = 
| crosses       = 
| chalices      = 
| chests        = 
| par           = 
| song          = 
| secrets       = 
| previouslevel = 
| nextlevel     = 
}}
</pre>

<noinclude>[[Category:Template documentation]]</noinclude>

Paste that to Template:Infobox Wolf3D level/doc (substituting in the name of your infobox) on your wiki[footnotes 1] Remember, though, that you need to substitute in your default syntax for what I've pasted here.

Be bold! Edit

I've only outlined the basics of editing infoboxes. Feel free to be bold and try editing them further! If you mess up, you can always undo the edits from the page's history.

And always feel free to ask someone for help if you need it!

And I would love it if you would send me a message if my blogs helped you!

Notes Edit

  1. 1.0 1.1 A number of times, this page refers to pages on your wiki, such as "Template:Infobox on your wiki". I don't know what your wiki is, so I can't directly link to it, but if you're having trouble finding the correct page, just click the link to go to the equivalent page on Community Central, then edit the URL so that community.wikia.com is substituted with your wiki's URL: for example wolfenstein.wikia.com.

See also Edit

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