How to Create an Infobox: Difference between revisions
m (Text replacement - "\{\{[\s_]+([^•].)" to "{{$1") |
|||
(107 intermediate revisions by 6 users not shown) | |||
Line 7: | Line 7: | ||
|hours open=Mon 1pm - 6pm | |hours open=Mon 1pm - 6pm | ||
}} | }} | ||
==What are Infoboxes?== | ===What are Infoboxes?=== | ||
Infoboxes are nothing more than a table saved as a template. Infoboxes are usually in the upper right | Infoboxes are nothing more than a table saved as a template. Infoboxes are usually in the upper right hand corner of an article. May contain information on leadership, meeting times and it's goals, etc. | ||
==How to create an Infobox== | ===How to create an Infobox=== | ||
Again | Again an infobox is a table. If you know how to create tables in Wikitext or HTML, it is not difficult. If you do not know Wikitext or HTLM, you will probably need someone who does to help you. If you would like to learn these two programs, see [[Wikitext - Lesson One|Wikitext]] or [[HTML and Wikitext - Lesson One|HTML Programming]]. Neither of these programming languages are difficult. | ||
===Step One - Create the table=== | ====Step One - Create the table==== | ||
*We are going to assume you know a little Wikitext and HTML in this tutorial. We will begin by creating a simple table. The coding will be displayed in both Wikitext and HTML side by side so can see the difference. | *We are going to assume you know a little Wikitext and HTML in this tutorial. We will begin by creating a simple table. The coding will be displayed in both Wikitext and HTML side by side so can see the difference. It is recommended that you create infobox tables in HTML as there few problems as you will see. | ||
*We will be creating an infobox as shown above. Wikitext and HTML will be displayed side by side so you can see the difference between them. So let us create a infobox for an organization: | |||
*We will be creating an infobox as shown above. | |||
So let us create a infobox for an organization: | |||
<table style="border:1px solid blue; "> | <table style="border:1px solid blue; "> | ||
<tr> | <tr> | ||
<td style="border:1px solid blue; text-align:center; font-size:16pt; ">Wikitext</td> | <td style="width:50%; border:1px solid blue; text-align:center; font-size:16pt; ">Wikitext</td> | ||
<td style="border:1px solid blue; text-align:center; font-size:16pt; ">HTML</td> | <td style="width:50%; border:1px solid blue; text-align:center; font-size:16pt; ">HTML</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td style="border:1px solid blue; "> | <td style="width:50%; border:1px solid blue; "> | ||
<nowiki>{|</nowiki> | <nowiki>{| class="infobox"</nowiki> <br> | ||
<nowiki>|-</nowiki><br> | <nowiki>|-</nowiki><br> | ||
<nowiki>|colspan="2 | <nowiki>|colspan="2"|organization</nowiki><br><br> | ||
<nowiki>|-</nowiki><br> | <nowiki>|-</nowiki><br> | ||
<nowiki>|colspan="2"|image</nowiki><br><br> | <nowiki>|colspan="2"|image</nowiki><br><br> | ||
Line 45: | Line 42: | ||
</td> | </td> | ||
<td style="border:1px solid blue; "> | <td style="width:50%; border:1px solid blue; "> | ||
<nowiki><table | <nowiki><table class="infobox"></nowiki><br> | ||
<nowiki><tr></nowiki><br> | <nowiki><tr></nowiki><br> | ||
<nowiki><td colspan="2"></nowiki>organization<nowiki></td></nowiki><br> | <nowiki><td colspan="2"></nowiki>organization<nowiki></td></nowiki><br> | ||
Line 54: | Line 51: | ||
<nowiki></tr></nowiki><br> | <nowiki></tr></nowiki><br> | ||
<nowiki><tr></nowiki><br> | <nowiki><tr></nowiki><br> | ||
<nowiki><td>President:</td></nowiki><br> | <nowiki><td></nowiki>President:<nowiki></td></nowiki><br> | ||
<nowiki><td></nowiki>president<nowiki></td></nowiki><br> | <nowiki><td></nowiki>president<nowiki></td></nowiki><br> | ||
<nowiki></tr></nowiki><br> | <nowiki></tr></nowiki><br> | ||
<nowiki><tr></nowiki><br> | <nowiki><tr></nowiki><br> | ||
<nowiki><td>Address:</td></nowiki><br> | <nowiki><td></nowiki>Address:<nowiki></td></nowiki><br> | ||
<nowiki><td></nowiki>address<nowiki></td></nowiki><br> | <nowiki><td></nowiki>address<nowiki></td></nowiki><br> | ||
<nowiki></tr></nowiki><br> | <nowiki></tr></nowiki><br> | ||
<nowiki><tr></nowiki><br> | <nowiki><tr></nowiki><br> | ||
<nowiki><td>Phone:</td></nowiki><br> | <nowiki><td></nowiki>Phone:<nowiki></td></nowiki><br> | ||
<nowiki><td></nowiki>phone<nowiki></td></nowiki><br> | <nowiki><td></nowiki>phone Number<nowiki></td></nowiki><br> | ||
<nowiki></tr></nowiki><br> | <nowiki></tr></nowiki><br> | ||
<nowiki><tr></nowiki><br> | <nowiki><tr></nowiki><br> | ||
<nowiki><td>Hours Open:</td></nowiki><br> | <nowiki><td></nowiki>Hours Open:<nowiki></td></nowiki><br> | ||
<nowiki><td></nowiki>hours open<nowiki></td></nowiki><br> | <nowiki><td></nowiki>hours open<nowiki></td></nowiki><br> | ||
<nowiki></tr></nowiki><br> | <nowiki></tr></nowiki><br> | ||
Line 73: | Line 70: | ||
</tr> | </tr> | ||
</table> | </table> | ||
*Now pay close attention to the table tags. You should notice | *Now pay close attention to the table tags. You should notice this coding: <font color="red"><nowiki>class="infobox"</nowiki></font color> in the table tag . This code tells the browser that a infobox is being created and to place it on the right hand side of the article. | ||
*Since the name of the organization and the image will extend over the two columns which contain the information about the organization | *Since the name of the organization and the image will extend over the two columns which contain the information about the organization we will install <font color="red">colspan="2"</font color> in the organization and image coding. | ||
*As it stands, the HTML coding is ok at this point, but the Wikitext has a problem. Normally the Wikitext as is will work for any table, however, we are going to be installing <em>parameters</em> which require us to replace the |'s in the Wikitext with <font color="red"><nowiki>{{{!}}}</nowiki></font color>. The reason is a bit beyond the scope of this article but if you are interested [[Template:!|click here]] | *As it stands, the HTML coding is ok at this point, but the Wikitext has a problem. Normally the Wikitext as is will work for any table, however, we are going to be installing <em>parameters</em> which require us to replace the |'s in the Wikitext with <font color="red"><nowiki>{{{!}}}</nowiki></font color>. The reason is a bit beyond the scope of this article but if you are interested [[Template:!|click here]] | ||
<table style="border:1px solid blue; "> | <table style="border:1px solid blue; "> | ||
<tr> | <tr> | ||
<td style="border:1px solid blue; text-align:center; font-size:16pt; ">Wikitext</td> | <td style="width:50%; border:1px solid blue; text-align:center; font-size:16pt; ">Wikitext</td> | ||
<td style="border:1px solid blue; text-align:center; font-size:16pt; ">HTML</td> | <td style="width:50%; border:1px solid blue; text-align:center; font-size:16pt; ">HTML</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td style="border:1px solid blue; "> | <td style="width:50%; border:1px solid blue; "> | ||
<nowiki>{| class="infobox | <nowiki>{| class="infobox"</nowiki> <br> | ||
<font color="red"><nowiki>{{{!}}}-</nowiki></font color><br> | <font color="red"><nowiki>{{{!}}}-</nowiki></font color><br> | ||
<font color="red"><nowiki>{{{!}}}</nowiki></font color>colspan="2"<font color="red"><nowiki>{{{!}}}</nowiki></font color>organization<br> | <font color="red"><nowiki>{{{!}}}-</nowiki></font color>colspan="2"<font color="red"><nowiki>{{{!}}}-</nowiki></font color>organization<br> | ||
<font color="red"><nowiki>{{{!}}}-</nowiki></font color><br> | <font color="red"><nowiki>{{{!}}}-</nowiki></font color><br> | ||
<font color="red"><nowiki>{{{!}}}</nowiki></font color>colspan="2"<font color="red"><nowiki>{{{!}}}</nowiki></font color>image<br> | <font color="red"><nowiki>{{{!}}}-</nowiki></font color>colspan="2"<font color="red"><nowiki>{{{!}}}-</nowiki></font color>image</nowiki><br> | ||
<font color="red"><nowiki>{{{!}}}-</nowiki></font color><br> | <font color="red"><nowiki>{{{!}}}-</nowiki></font color><br> | ||
<font color="red"><nowiki>{{{!}}}</nowiki></font color>President:<br> | <font color="red"><nowiki>{{{!}}}-</nowiki></font color>President:<br> | ||
<font color="red"><nowiki>{{{!}}}</nowiki></font color>president<br><br> | <font color="red"><nowiki>{{{!}}}-</nowiki></font color>president<br><br> | ||
<font color="red"><nowiki>{{{!}}}-</nowiki></font color><br> | <font color="red"><nowiki>{{{!}}}-</nowiki></font color><br> | ||
<font color="red"><nowiki>{{{!}}}</nowiki></font color>Address:<br> | <font color="red"><nowiki>{{{!}}}-</nowiki></font color>Address:<br> | ||
<font color="red"><nowiki>{{{!}}}</nowiki></font color>address<br><br> | <font color="red"><nowiki>{{{!}}}-</nowiki></font color>address<br><br> | ||
<font color="red"><nowiki>{{{!}}}-</nowiki></font color><br> | <font color="red"><nowiki>{{{!}}}-</nowiki></font color><br> | ||
<font color="red"><nowiki>{{{!}}}</nowiki></font color>Phone:<br> | <font color="red"><nowiki>{{{!}}}-</nowiki></font color>Phone:<br> | ||
<font color="red"><nowiki>{{{!}}}</nowiki></font color>phone<br><br> | <font color="red"><nowiki>{{{!}}}-</nowiki></font color>phone<br><br> | ||
<font color="red"><nowiki>{{{!}}}-</nowiki></font color><br> | <font color="red"><nowiki>{{{!}}}-</nowiki></font color><br> | ||
<font color="red"><nowiki>{{{!}}}</nowiki></font color>Hours Open:><br> | <font color="red"><nowiki>{{{!}}}-</nowiki></font color>Hours Open:><br> | ||
<font color="red"><nowiki>{{{!}}}</nowiki></font color>hours open<br><br> | <font color="red"><nowiki>{{{!}}}-</nowiki></font color>hours open<br><br> | ||
<nowiki>|}</nowiki> | <nowiki>|}</nowiki> | ||
</td> | </td> | ||
<td style="border:1px solid blue; "> | <td style="width:50%; border:1px solid blue; "> | ||
<nowiki><table class="infobox | <nowiki><table class="infobox"></nowiki><br> | ||
<nowiki><tr></nowiki><br> | <nowiki><tr></nowiki><br> | ||
<nowiki><td colspan="2"></nowiki>organization<nowiki></td></nowiki><br> | <nowiki><td colspan="2"></nowiki>organization<nowiki></td></nowiki><br> | ||
Line 131: | Line 127: | ||
</tr> | </tr> | ||
</table> | </table> | ||
*The Wikitext looks a bit messy right now, but the substitution of the <font color | *The Wikitext looks a bit messy right now, but the substitution of the <nowiki></font color>{{{!}}}</nowiki></font color> for the | will save a lot of headaches later. Notice that nothing had to be done to the HTML coding. Even though it looks like the Wikitext has less programming, it is a lot trickier to program infoboxes than in HTLM. That's why it is recommended to program infoboxes in HTML rather than Wikitext. | ||
===Step Two - More Coding=== | ====Step Two - More Coding==== | ||
*Next step is to | *Next step is to add parameters which are formated like so: <font color><nowiki>{{{</nowiki></font color>name of parameter<font color><nowiki>}}}</nowiki></font color>. We will add them to the table below. Notice that there are three opening and closing curly brackets around each one. | ||
<table style="border:1px solid blue; "> | <table style="border:1px solid blue; "> | ||
<tr> | <tr> | ||
<td style="border:1px solid blue; text-align:center; font-size:16pt; ">Wikitext</td> | <td style="width:50%; border:1px solid blue; text-align:center; font-size:16pt; ">Wikitext</td> | ||
<td style="border:1px solid blue; text-align:center; font-size:16pt; ">HTML</td> | <td style="width:50%; border:1px solid blue; text-align:center; font-size:16pt; ">HTML</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td style="border:1px solid blue; "> | <td style="width:50%; border:1px solid blue; "> | ||
<nowiki>{| class="infobox | <nowiki>{| class="infobox"</nowiki> <br> | ||
<nowiki>{{{!}}}-</nowiki><br> | <nowiki>{{{!}}}-</nowiki><br> | ||
<nowiki>{{{!}}}colspan="2"{{{!}}}</nowiki><font color | <nowiki>{{{!}}}colspan="2"{{{!}}}</nowiki><font color><nowiki>{{{</nowiki></font color>organization<font color><nowiki>}}}</nowiki></font color><br><br> | ||
<nowiki>{{{!}}}-</nowiki><br> | <nowiki>{{{!}}}-</nowiki><br> | ||
<nowiki>{{{!}}}colspan="2"{{{!}}}</nowiki><font color | <nowiki>{{{!}}}colspan="2"{{{!}}}</nowiki><font color><nowiki>{{{</nowiki></font color>image<font color><nowiki>}}}</nowiki></font color><br><br> | ||
<nowiki>{{{!}}}-</nowiki><br> | <nowiki>{{{!}}}-</nowiki><br> | ||
<nowiki>{{{!}}}President:</nowiki><br> | <nowiki>{{{!}}}President:</nowiki><br> | ||
<nowiki>{{{!}}}</nowiki><font color | <nowiki>{{{!}}}</nowiki><font color><nowiki>{{{</nowiki></font color>president<font color><nowiki>}}}</nowiki></font color><br><br> | ||
<nowiki>{{{!}}}-</nowiki><br> | <nowiki>{{{!}}}-</nowiki><br> | ||
<nowiki>{{{!}}}Address:</nowiki><br> | <nowiki>{{{!}}}Address:</nowiki><br> | ||
<nowiki>{{{!}}}</nowiki><font color | <nowiki>{{{!}}}</nowiki><font color><nowiki>{{{</nowiki></font color>address<font color><nowiki>}}}</nowiki></font color><br><br> | ||
<nowiki>{{{!}}}-</nowiki><br> | <nowiki>{{{!}}}-</nowiki><br> | ||
<nowiki>{{{!}}}Phone:</nowiki><br> | <nowiki>{{{!}}}Phone:</nowiki><br> | ||
<nowiki>{{{!}}}</nowiki><font color | <nowiki>{{{!}}}</nowiki><font color><nowiki>{{{</nowiki></font color>phone<font color><nowiki>}}}</nowiki></font color></nowiki><br><br> | ||
<nowiki>{{{!}}}-</nowiki><br> | <nowiki>{{{!}}}-</nowiki><br> | ||
<nowiki>{{{!}}}Hours Open:</nowiki><br> | <nowiki>{{{!}}}Hours Open:</nowiki><br> | ||
<nowiki>{{{!}}}</nowiki><font color | <nowiki>{{{!}}}</nowiki><font color><nowiki>{{{</nowiki></font color>hours open<font color><nowiki>}}}</nowiki></font color></nowiki><br><br> | ||
<nowiki>|}</nowiki> | <nowiki>|}</nowiki> | ||
</td> | </td> | ||
<td style="border:1px solid blue; "> | <td style="width:50%; border:1px solid blue; "> | ||
<nowiki><table class="infobox | <nowiki><table class="infobox"></nowiki><br> | ||
<nowiki><tr></nowiki><br> | <nowiki><tr></nowiki><br> | ||
<nowiki><td colspan="2"></ | <nowiki><td colspan="2"></nowiki>{{{organization}}} | ||
<nowiki></td></nowiki><br> | <nowiki></td></nowiki><br> | ||
<nowiki></tr></nowiki><br> | <nowiki></tr></nowiki><br> | ||
<nowiki><tr></nowiki><br> | <nowiki><tr></nowiki><br> | ||
<nowiki><td colspan="2"></ | <nowiki><td colspan="2"></nowiki>{{{image}}} | ||
<nowiki></td></nowiki><br> | <nowiki></td></nowiki><br> | ||
<nowiki></tr></nowiki><br> | <nowiki></tr></nowiki><br> | ||
<nowiki><tr></nowiki><br> | <nowiki><tr></nowiki><br> | ||
<nowiki><td></nowiki>President:<nowiki></td></nowiki><br> | <nowiki><td></nowiki>President:<nowiki></td></nowiki><br> | ||
<nowiki><td></ | <nowiki><td></nowiki>{{{president}}}<nowiki></td></nowiki><br> | ||
<nowiki></tr></nowiki><br> | <nowiki></tr></nowiki><br> | ||
<nowiki><tr></nowiki><br> | <nowiki><tr></nowiki><br> | ||
<nowiki><td></nowiki>Address:<nowiki></td></nowiki><br> | <nowiki><td></nowiki>Address:<nowiki></td></nowiki><br> | ||
<nowiki><td></ | <nowiki><td></nowiki>{{{address}}}<nowiki></td></nowiki><br> | ||
<nowiki></tr></nowiki><br> | <nowiki></tr></nowiki><br> | ||
<nowiki><tr></nowiki><br> | <nowiki><tr></nowiki><br> | ||
<nowiki><td></nowiki>Phone:<nowiki></td></nowiki><br> | <nowiki><td></nowiki>Phone:<nowiki></td></nowiki><br> | ||
<nowiki><td></ | <nowiki><td></nowiki>{{{phone}}}<nowiki></td></nowiki><br> | ||
<nowiki></tr></nowiki><br> | <nowiki></tr></nowiki><br> | ||
<nowiki><tr></nowiki><br> | <nowiki><tr></nowiki><br> | ||
<nowiki><td></nowiki>Hours Open:<nowiki></td></nowiki><br> | <nowiki><td></nowiki>Hours Open:<nowiki></td></nowiki><br> | ||
<nowiki><td></ | <nowiki><td></nowiki>{{{hours open}}}<nowiki></td></nowiki><br> | ||
<nowiki></tr></nowiki><br> | <nowiki></tr></nowiki><br> | ||
<nowiki></table></nowiki> | <nowiki></table></nowiki> | ||
Line 193: | Line 188: | ||
</tr> | </tr> | ||
</table> | </table> | ||
*Notice all we have done | *Notice all we have done is enclose the parameter we want to place information with opening and closing {{{ }}}. That is all. It will be in the parameters where we put the information that we see in the infobox. | ||
*In the wikitext, things are really getting hard to differentiate. There are a lot of curly brackets on the code | *In the wikitext, things are really getting hard to differentiate. There are a lot of curly brackets on the code. | ||
===Step Three - Placing the Infobox=== | ===Step Three - Placing the Infobox=== | ||
*To place this infobox we type the usual coding we use to place templates, which | *To place this infobox we type the usual coding we use to place templates, which our example is <nowiki>{{Infobox sample}}</nowiki>. However, it will be displayed as such:{{Infobox sample}}. | ||
*Notice no information appears | *Notice no information appears only the parameters for the name of the organization inside the curly brackets. We now have to add the following code inside the placement coding<br><br> | ||
<nowiki>{{Infobox sample</nowiki><br> | <nowiki>{{Infobox sample</nowiki><br> | ||
<font color="red"><nowiki>|organization=</nowiki><br> | <font color="red"><nowiki>|organization=</nowiki><br> | ||
Line 208: | Line 203: | ||
<nowiki>}}</nowiki> | <nowiki>}}</nowiki> | ||
*Notice that for every parameter there is a | *Notice that for every parameter there is a |, the name of the parameter followed by an = sign. It is after the = sign that you add the proper information for the organization. For example, if you are wanting to place the name of the president you would type it after the = sign like so: <nowiki>|president=John Smith</nowiki>. | ||
{{Infobox sample | {{Infobox sample | ||
|organization=Genealogy Society | |organization=Genealogy Society | ||
Line 218: | Line 213: | ||
}} | }} | ||
That is all there is to it. Simple. | That is all there is to it. Simple. | ||
*When you save the page, the | *When you save the page, the <nowiki>{{{president}}}</nowiki> is replaced by John Smith. | ||
*Now if we add the following information after the = signs like so: | *Now if we add the following information after the = signs like so: | ||
<nowiki>{{Infobox sample</nowiki><br> | <nowiki>{{Infobox sample</nowiki><br> | ||
<nowiki>|organization= | <nowiki>|organization=[[File:France Lavender Field.jpg|150px]]</nowiki><br> | ||
<nowiki>|organization=</nowiki>Society Name<br> | |||
<nowiki>|president=</nowiki | <nowiki>|president=</nowiki>John Smith<br> | ||
<nowiki>|address=</nowiki | <nowiki>|address=</nowiki>1234 Hill St, Any City<br> | ||
<nowiki>|phone=</nowiki | <nowiki>|phone=</nowiki>360-555-1234<br> | ||
<nowiki>|open hours=</nowiki | <nowiki>|open hours=</nowiki>Mon 1pm - 6pm<br> | ||
<nowiki>}}</nowiki> | <nowiki>}}</nowiki> | ||
*We will get the following: | *We will get the following: | ||
*Notice that we use the usual coding for placing an image. We have limited the image to 150px wide as the infobox is 200px wide. If you did not limit the size of the image. the infobox would expand to the width of the image as it stands in the files. | *Notice that we use the usual coding for placing an image. We have limited the image to 150px wide as the infobox is 200px wide. If you did not limit the size of the image. the infobox would expand to the width of the image as it stands in the files. | ||
===Step Four - Limiting | ===Step Four - Limiting Parameters=== | ||
{{Infobox sample | {{Infobox sample | ||
|organization=Genealogy Society | |organization=Genealogy Society | ||
Line 242: | Line 236: | ||
|hours open=Mon 1pm - 6pm | |hours open=Mon 1pm - 6pm | ||
}} | }} | ||
*Some infoboxes can get very long. If you list all the attributes of an organization can possibly there can be | *Some infoboxes can get very long. If you list all the attributes of an organization can possibly there can be quit a few items listed. | ||
* | *What if you placing an infobox for a small organization, but are using the infobox for a large organizations with many offices you could end up with an infobox taking up a lot of room on the page with little information in it. Maybe the organization does even have a phone number like in our example here. | ||
*Well | *Well it is possible to code the infobox so that the item "phone" does not appear if there is none. It is done simply by adding this coding to the parameter. | ||
Revision as of 11:48, 18 September 2014
Genealogy Society | |
![]() |
|
President: | John Smith |
Address: | 1234 Hill St, Any City |
Phone: | 360-555-1234 |
Hours Open: | Mon 1pm - 6pm |
What are Infoboxes?[edit | edit source]
Infoboxes are nothing more than a table saved as a template. Infoboxes are usually in the upper right hand corner of an article. May contain information on leadership, meeting times and it's goals, etc.
How to create an Infobox[edit | edit source]
Again an infobox is a table. If you know how to create tables in Wikitext or HTML, it is not difficult. If you do not know Wikitext or HTLM, you will probably need someone who does to help you. If you would like to learn these two programs, see Wikitext or HTML Programming. Neither of these programming languages are difficult.
Step One - Create the table[edit | edit source]
- We are going to assume you know a little Wikitext and HTML in this tutorial. We will begin by creating a simple table. The coding will be displayed in both Wikitext and HTML side by side so can see the difference. It is recommended that you create infobox tables in HTML as there few problems as you will see.
- We will be creating an infobox as shown above. Wikitext and HTML will be displayed side by side so you can see the difference between them. So let us create a infobox for an organization:
Wikitext | HTML |
{| class="infobox" |
<table class="infobox"> |
- Now pay close attention to the table tags. You should notice this coding: class="infobox" in the table tag . This code tells the browser that a infobox is being created and to place it on the right hand side of the article.
- Since the name of the organization and the image will extend over the two columns which contain the information about the organization we will install colspan="2" in the organization and image coding.
- As it stands, the HTML coding is ok at this point, but the Wikitext has a problem. Normally the Wikitext as is will work for any table, however, we are going to be installing parameters which require us to replace the |'s in the Wikitext with {{{!}}}. The reason is a bit beyond the scope of this article but if you are interested click here
Wikitext | HTML |
{| class="infobox" |
<table class="infobox"> |
- The Wikitext looks a bit messy right now, but the substitution of the </font color>{{{!}}} for the | will save a lot of headaches later. Notice that nothing had to be done to the HTML coding. Even though it looks like the Wikitext has less programming, it is a lot trickier to program infoboxes than in HTLM. That's why it is recommended to program infoboxes in HTML rather than Wikitext.
Step Two - More Coding[edit | edit source]
- Next step is to add parameters which are formated like so: {{{name of parameter}}}. We will add them to the table below. Notice that there are three opening and closing curly brackets around each one.
Wikitext | HTML |
{| class="infobox" |
<table class="infobox"> |
- Notice all we have done is enclose the parameter we want to place information with opening and closing {{{ }}}. That is all. It will be in the parameters where we put the information that we see in the infobox.
- In the wikitext, things are really getting hard to differentiate. There are a lot of curly brackets on the code.
Step Three - Placing the Infobox[edit | edit source]
- To place this infobox we type the usual coding we use to place templates, which our example is {{Infobox sample}}. However, it will be displayed as such:
{{{organization}}} {{{image}}} Phone: {{{phone}}} Hours Open: {{{hours open}}} .
- Notice no information appears only the parameters for the name of the organization inside the curly brackets. We now have to add the following code inside the placement coding
{{Infobox sample
|organization=
|image=
|president=
|address=
|phone=
|open hours=
}}- Notice that for every parameter there is a |, the name of the parameter followed by an = sign. It is after the = sign that you add the proper information for the organization. For example, if you are wanting to place the name of the president you would type it after the = sign like so: |president=John Smith.
Genealogy Society President: John Smith Address: 1234 Hill St, Any City Phone: 360-555-1234 Hours Open: Mon 1pm - 6pm
That is all there is to it. Simple.- When you save the page, the {{{president}}} is replaced by John Smith.
- Now if we add the following information after the = signs like so:
{{Infobox sample
|organization=[[File:France Lavender Field.jpg|150px]]
|organization=Society Name
|president=John Smith
|address=1234 Hill St, Any City
|phone=360-555-1234
|open hours=Mon 1pm - 6pm
}}- We will get the following:
- Notice that we use the usual coding for placing an image. We have limited the image to 150px wide as the infobox is 200px wide. If you did not limit the size of the image. the infobox would expand to the width of the image as it stands in the files.
Step Four - Limiting Parameters[edit | edit source]
Genealogy Society President: John Smith Address: 1234 Hill St, Any City Phone: 360-555-1234 Hours Open: Mon 1pm - 6pm
- Some infoboxes can get very long. If you list all the attributes of an organization can possibly there can be quit a few items listed.
- What if you placing an infobox for a small organization, but are using the infobox for a large organizations with many offices you could end up with an infobox taking up a lot of room on the page with little information in it. Maybe the organization does even have a phone number like in our example here.
- Well it is possible to code the infobox so that the item "phone" does not appear if there is none. It is done simply by adding this coding to the parameter.
- Notice no information appears only the parameters for the name of the organization inside the curly brackets. We now have to add the following code inside the placement coding