Tardis:Infobox development 2009 to 2011/How collapsing fields work

Collapsing fields, also known as auto-collapse and countless other names is (in this usage) all about making portions of the infobox that have no information in them collapse (so they can't be seen on the article).

This feature has been slowly implemented onto the Template:Infobox Individual, Template:Infobox Astronomical Object and Template:Infobox Species infoboxes. But to demonstrate how it functions (and the code behind it, the original and the test infobox will be shown below).

Regular Infobox
This is the infobox prior to any alterations:

You can see that all fields that are not filled in are present, with nothing beside them (featuring, enemy, writer, director, release date next release).

Edited infobox
This is the edited infobox. (You'll need to look at the code for this). But as you can see the areas of the infobox that are not filled in are not present in the final infobox. Please note that all fields of the infobox need to be present in order for this to function.

How this works
Below is the code that generates the above infobox (titled 'Edited infobox). If you've looked at the code of other infoboxes used on this wiki, they are generally the same, just with different names and colours swapped in and out.

For the collapsing fields to function a piece of code is added onto the code. This is: This is added above whichever field that you wish to collapse and it is placed instead of:
 * |- class="hiddenStructure" style="vertical-align: top;"
 * |- valign="top"

Adding this code makes whichever name listed within the { – } autocollapse or be a hidden feature.

There is one important fact to remember, in order for this feature to function on article pages all of the fields listed for the infobox must be present, other wise within the infobox you will see something like on the article. This means the whole infobox needs to be intact for this to function correctly.