How to Create an Infobox: Difference between revisions

m
Line 245: Line 245:
*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:<font color="red"><nowiki>{{#if:{{{president|}}}|</nowiki></font color="red"><nowiki>{{{!}}}President{{{!}}}{{{president}}}</nowiki><font color="red">}}</font color></td>
:*Wikitext:
:::<font color="red"><nowiki>{{#if:{{{president|}}}|</nowiki></font color="red"><nowiki>{{{!}}}President{{{!}}}{{{president}}}</nowiki><font color="red">}}</font color></td>


:*HTML:<font color="red"><nowiki>{{#if:{{{president|}}}|</nowiki></font color="red"><nowiki><td>President</td><td>{{{president}}}</nowiki><font color="red">}}</font color></td>
:*HTML:
:::<font color="red"><nowiki>{{#if:{{{president|}}}|</nowiki></font color="red"><nowiki><td>President</td><td>{{{president}}}</nowiki><font color="red">}}</font color></td>
<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]</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]</ref>.   
Line 335: Line 337:
</table>
</table>
*What this coding means that if you do not put anything after the = sign on the President line, this item will not appear in the infobox.  So if you have a long infobox but few items to fill in, the infobox will shrink up to fit the information you have added.
*What this coding means that if you do not put anything after the = sign on the President line, this item will not appear in the infobox.  So if you have a long infobox but few items to fill in, the infobox will shrink up to fit the information you have added.
==Adding More Fields==
==Adding More Fields==
If you want to add more fields 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 fields 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:
Interface administrators, smwadministrator, smwcurator, smweditor
82,369

edits