How to Create an Infobox: Difference between revisions

m
Line 180: Line 180:
===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 our example is <nowiki>{{Infobox sample}}</nowiki>.  However, it will be displayed as such:{{Infobox sample}}.  
*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 only the parameters inside the curly brackets.  We now have to add the following code inside the placement coding<br><br>
*Notice no information appears only the parameters inside the curly brackets.  We now have to add the following code inside the double {{ }}:<br><br>
<nowiki>{{Infobox sample</nowiki><br>
<nowiki>{{Infobox sample</nowiki><br>
<nowiki>|organization=</nowiki><br>
<nowiki>|organization=</nowiki><br>
Line 191: Line 190:
*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>.  That is all there is to it.  Simple.
*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>.  That is all there is to it.  Simple.
*When you save the page, the <nowiki>{{{president}}}</nowiki> is replaced by John Smith.
*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:
<nowiki>{{Infobox sample</nowiki><br>
<nowiki>|organization=</nowiki>Society Name<br>
<nowiki>|president=</nowiki>John Smith<br>
<nowiki>|address=</nowiki>1234 Hill St, Any City<br>
<nowiki>|phone=</nowiki>360-555-1234<br>
<nowiki>|open hours=</nowiki>Mon 1pm - 6pm<br>
<nowiki>}}</nowiki>
We will get the following:


===Step Four - Limiting Parameters===
===Step Four - Limiting Parameters===
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.  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.
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.  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.
Interface administrators, smwadministrator, smwcurator, smweditor
82,369

edits