User:Ccsmith/sandbox/wiki

=FamilySearch Wiktext Infobox - Continued=

Collapsing Infoboxes
In our example in the last lesson: we have limited the items shown for the organization as shown above. But as you know many organizations have far more offices and other items that would be worth knowing that should be in these infoboxes. But then again some having even less, so how can you create an infoboxes that has all the things, but only the things which are filled in show in the infobox. Well that is possible with another bit of coding call "if functions." What we would like to happen, when a parameter is filled in, it shows, but if it is blank, the item does not show in the infobox. In other words, if the organization does not have a phone number, it would not even show.
 * 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:
 * Wikitext:


 * |if functions
 * HTML:

This coding looks a bit intimidating but it is really not hard

Yoy can create long infoboxes
With this coding, you can create a complete infobox that covers all the items you think are necessary, but has the ability to be flexible enough to shrink if not all the items are present such as a vice president or web site address.

Try these out
 Exercises

Use this coding for this exercise: Lets make this into a infobox: Check your answers
 * 1) Put a border around the infobox, limit the width to 190 pixels and make it so that will always be on the right side of the page.
 * 2) Put borders around each of the cells.
 * 3) Have the cells containing the words organization and image span both columns.
 * 4) Center the name of the organization and the image in their cells.
 * 5) Make the items in the right hand cells into parameters.

 Quick Quiz
 * Parameters have two opening and closing curly brackets surrounding them.
 * A. True
 * B. False


 * Infoboxes usually are located at the top of the page on the right side.
 * A. True
 * B. False


 * Infoboxes are saved just like other templates but it is good practice to included the word "infobox" in its title.
 * A. True
 * B. False

Check your answers