Jump to content

Template:Infobox table

From Wikinews, the free news source you can write!
field value
[edit] Template documentation

Usage

This template generates a wikitable of data for customizing the infobox for a give category, as generated by template {{infobox}}. The customizing table for a category Foobar should be placed in a page called Template:Infobox/lookup/Foobar.

Format the call to this template like this:

{{infobox table|
|image=Example.svg
|image heading=An example image.  {{image|[[Commons:User:Nethac DIU|Nethac DIU]]}}
}}

specifying whichever of the customizing parameters you want (in this example, image and image heading). Following is a list of the recognized customizing parameters, as of this writing, with their meanings and default values. Caveat: these default values apply to fields not specified by a table; not to be confused with the behavior of {{infobox}} when there is no table specific to the category of the infobox.

parameter default what it does
label If non-blank, the label on the category link at the top of the infobox.
list heading Related articles Appears just above the list of recently published articles in the category.
list dates If non-blank, publication dates are listed for the listed articles.
list length 5 How many articles to list.
image heading If non-blank, this heading is placed just above the main image.
image If not=blank, the main image.
image size available width The width for display of the main image. Available width is 200px if unpadded, 196px if padded (irregular or with heading).
image caption The caption for the image, visible as a mouseover.
image irregular If non-blank, the image is non-rectangular, so a little extra space should be left around it to avoid odd appearance.
image padding If non-blank, the specified amount of extra space is left around the image; supersedes image irregular.
image at top If non-blank, the main image is placed above the article list rather than below. Leave this blank if there is no main image.
bottom image If non-blank, an image to display at the very bottom of the infobox.
bottom image size 60px The width for display of the bottom image.
image n
  for 2≤n≤12
If non-blank, an alternative main image; selected by rotation via {{infobox/select}}.

Ordinarily, the page that calls {{infobox table}} is automatically added to Category:Infobox tables. Passing a non-blank value to template parameter nocat suppressed this categorization.

Internals

This template generates a wikitable, which is parsed by {{infobox}}; but {{infobox}} does not itself interpret the parameters or even validate them, it just passes whatever it finds to {{infobox/p1}}, as an S-exression. {{infobox/p1}} validates the parameters and passes them as template parameters to {{infobox/p2}}, which is responsible for using them to build the infobox. If it becomes needful to add to or otherwise change the set of valid parameters, the following templates are the ones that need to be modified: {{infobox table}} (and its documentation, above); {{infobox/p1}}; {{infobox/p2}}; and, if the number of selectable images changes, {{infobox/select}}.

See also