How to Create an Infobox: Difference between revisions

Changed "Rating" to "Content".
m (Text replacement - "\{\{[\s_]+([^•].)" to "{{$1")
(Changed "Rating" to "Content".)
 
Line 246: Line 246:
*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.   
*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.   
*This is an example of adding the additional code to the President line:<br><br>
*This is an example of adding the additional code to the President line:<br><br>
:*Wikitext:
{{Block indent|*Wikitext:}}
:::<font color="red"><nowiki>{{#if:{{{president|}}}|</nowiki></font color="red"><nowiki>{{{!}}}President{{{!}}}{{{president}}}</nowiki><font color="red">}}</font color></td>
{{Block indent|1=<font color="red"><nowiki>{{#if:{{{president|}}}|</nowiki></font color="red"><nowiki>{{{!}}}President{{{!}}}{{{president}}}</nowiki><font color="red">}}</font color></td>|2=3}}


:*HTML:
{{Block indent|*HTML:}}
:::<font color="red"><nowiki>{{#if:{{{president|}}}|</nowiki></font color="red"><nowiki><td>President</td><td>{{{president}}}</nowiki><font color="red">}}</font color></td>
{{Block indent|1=<font color="red"><nowiki>{{#if:{{{president|}}}|</nowiki></font color="red"><nowiki><td>President</td><td>{{{president}}}</nowiki><font color="red">}}</font color></td>|2=3}}
<br><br>
<br><br>
This coding looks a bit intimidating but it is really not hard<ref>The coding is called Parser functions.  You can read more about them at [[Help:Magic words#Parser functions]] and [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions Parser Functions]</ref>.   
This coding looks a bit intimidating but it is really not hard<ref>The coding is called Parser functions.  You can read more about them at [[Help:Magic words#Parser functions]] and [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions Parser Functions]</ref>.   
Line 342: Line 342:
If you want to add more organizational information such as other officers, meeting places, etc, you just add more fields to the infobox template and the matching field to the infobox inserted template:
If you want to add more organizational information such as other officers, meeting places, etc, you just add more fields to the infobox template and the matching field to the infobox inserted template:
*In the infobox template:
*In the infobox template:
::<font color="red"><nowiki>{{#if:{{{vice president|}}}|</nowiki></font color><nowiki><td>Vice President:</td></nowiki>
{{Block indent|1=<font color="red"><nowiki>{{#if:{{{vice president|}}}|</nowiki></font color><nowiki><td>Vice President:</td></nowiki>|2=2}}
:*Remember where you place this code in the infobox template is where it will show up in the infobox.  So if you want the, in this example, the vice president to follow the name of the president you have to place right after the coding for the president.
{{Block indent|*Remember where you place this code in the infobox template is where it will show up in the infobox.  So if you want the, in this example, the vice president to follow the name of the president you have to place right after the coding for the president.}}
*In the inserted template:
*In the inserted template:
::<font color="red">|vice president=</font color>
{{Block indent|1=<font color="red">|vice president=</font color>|2=2}}
:*This coding can be put anywhere in the inserted template.  It does not affect the placement of the information in the infobox.  But if nothing is put after the = sign, this line will not appear.
{{Block indent|1=*This coding can be put anywhere in the inserted template.  It does not affect the placement of the information in the infobox.  But if nothing is put after the = sign, this line will not appear.|2=1}}


==Existing Infoboxes==
==Existing Infoboxes==
Approver, Batcheditor, Moderator, Patroller, Protector, Reviewer, Bots, Bureaucrats, editor, Interface administrators, pagecreator, pagedeleter, Page Ownership admin, Push subscription managers, Suppressors, Administrators, Upload Wizard campaign editors, Widget editors
321,763

edits