Fallout中文維基
Advertisement
Fallout中文維基
本頁包含了對此模板的使用説明:Infobox

Meta-template used for constructing infobox templates. Infoboxes are fixed-format tables designed to be added to the top right-hand corner of articles to consistently present a summary of the article content.

Up to 40 rows in as many groups with up to 4 columns each are supported. Every row can have a varying number of columns and groups can be made collapsible. Specific conditions can be specified for each row. In addition, the template supports up to 5 images in the main image area and dynamically calculates the appropriate width/height for each image.

Usage[]

{{Infobox
|games              ={{{games|}}}
|title              ={{{name|}}}
|subtitle           ={{{subtitle|}}}
|supertitle         =example
|supertitle link    =examples
|icon               ={{{icon|}}}
|main image1        ={{{image|}}}
|main image1 size   ={{{image size|}}}
|main image desc    ={{{image desc|}}}
|footer             ={{{footer|}}}
|group1             ={{{group1|}}}
|label1-1           ={{{label1|}}}
|content1-2         ={{{content1|}}}
}}

Most of the parameters should usually be passed down from the "end" infoboxes (i.e. the ones directly used in articles).

General explanations[]

  • A given row can contain either a group, an image or content and label cells; these 3 options are mutually exclusive. For example, if you specify group1, image1 and label1-1, only group1 will be shown. Order of priority: group > image > label > content.
  • The layout for each row is generated automatically based on which cells are specified in the row itself and in the group it belongs to. It is possible to have rows with different column counts within the same group; the cells in the row with less columns will then span multiple columns, depending on exactly which columns are used in this row.
    For example, if one row in a given group has 4 columns and another has only 2, the layout of the second row will vary depending on which columns are used:
    • If the first and the last cell are used, the first cell (of the second row) will span columns 1, 2 and 3 (of the first row).
    • If the first and the second cell were used, the second cell will span columns 2, 3 and 4.
    • If the first and the third cell were used, the first cell will span columns 1 and 2 while the second cell will span columns 3 and 4.

Parameters[]

Terms used in the parameter descriptions:

  • |example = value
    Defined and not empty: A parameter is "defined and not empty" if it has been set to any value. In the example on the right, the parameter example is defined and not empty.
  • |example =
    Defined and empty: A parameter is "defined and empty" if it is present on the page but has been set to no value. In the example on the right, the parameter example is defined and empty.
  •  
    Defined and not empty: A parameter is "undefined" if it is not present on the page. In the example on the right, the parameter example is undefined.
  • |example = @word
    Magic word: Magic words are terms which - when set as a parameter value - have a special effect. They are usually prefixed with an "@" in order to differentiate them from normal parameter values. In the example on the right, the parameter example is set to the magic word "@word".


Neutral
cond1 up to cond40
Condition for corresponding row. If a cond is defined and empty, the row is not shown. If a cond is defined and not empty, the row is shown. If a cond is undefined, the row is shown based on the default for its row type:
  • group rows: Only displayed if group is defined, not set to "@hide" and there are rows shown (not only specified) in the group.
  • image rows: Only displayed if image is defined and not set to "@hide".
  • content/label rows: If the row contains content cells, it is shown if at least one of the content cells is defined, not empty and not set to "@hide". If the row contains only label cells, it is shown if at least one of the label cells is defined, not empty and not set to "@hide".
Neutral
colwidths
Column widths in percent, separated by commas (e.g. "50, 50"). Only applied to groups where the number of specified widths matches the number of columns in said group (e.g. if two widths are specified, only groups with two columns will be affected); for groups with more or less columns, the default widths are used.
Neutral
colwidths0 up to colwidths40
Column widths in percent, separated by commas (e.g. "50, 50"). Only applied if the number of specified widths matches the number of columns in the group; otherwise colwidths (if that has a matching number of widths) or default widths are used. Overrides general colwidths parameter for the specific group.
Neutral
content1-1, content1-2, content1-3, content1-4 up to content40-1, content40-2, content40-3, content40-4
Content of corresponding cell. The first number in the parameter name indicates the row and the second number stands for the column (numbered from left to right).

Magic words:

  • @hide: If all defined content cells in a row are set to "@hide", the row is not shown regardless of other conditions or options.
Neutral
content1-1 tooltip up to content40-4 tooltip
Tooltip for corresponding cell, i.e. text which is displayed if a reader moves his/her mouse over the cell.
Neutral
footer
Text of the footer, i.e. a row at the very bottom of the infobox.
Neutral
games
Game abbreviation(s); for accepted abbreviations please see {{abb}}. Multiple abbreviations can be specified if separated by comma (,). These are used to create dynamic links for supertitle. For usage details, please see supertitle link below.
Neutral
group1 up to group40
Content of corresponding cell, with the number indicating the row.

Specifying a group row creates a new group (and a header), and all rows below it belong to that group until another group field is specified. For example, if you set group1, content2-1, image3, group4 and label5-1, row 2 & row 3 belong to group 1 and row 5 belongs to group 4.

All rows above the first specified group belong to group 0. For example, if you set image1, content2-1, image3, group4 and label5-1, row 2 & row 3 belong to group 0 and row 5 belongs to group 4.

Magic words:

  • @hide: Creates a group without a visible header.
Neutral
icon
File name of icon (without "File:"), i.e. the small image which is displayed in the top right corner of the main image area.
Neutral
(default: "0px")
icon offset
Offset for icon in pixels, i.e. the icon is moved "upwards" by the specified amount of pixels. The maximum value is "icon size-specified height + 5".

Magic words:

  • @outside: Icon is placed completely outside (above) the main image area.
Neutral
(default: "30x30px")
icon size
Size of icon in pixels. If no height/width is specified or the specified value exceeds the limit of 40px, the default icon height/width is used.
Neutral
image1 up to image40
File name of image (without "File:") to be displayed in corresponding cell, with the number indicating the row. If an image has been specified but has not been filled in, an "upload image" button will be displayed instead, prompting users to upload an image with a pre-defined file name (see image# default).

Magic words:

  • @hide: Hides the image (or "upload image" button) regardless of other conditions or options.
Neutral
(default: "{{PAGENAME}} #.jpg")
image1 default up to image40 default
The file name (without "File:") which is suggested when uploading an image via the "upload image" button in the corresponding cell. It is recommended to make this depend on {{PAGENAME}}.
Neutral
image1 desc up to image40 desc
Description for the corresponding image, displayed below the image.
Neutral
image1 size up to image40 size
Size for corresponding image in pixels. If the width of the image exceeds infobox width, the default width is used instead.
Neutral
label1-1, label1-2, label1-3, label1-4 up to label40-1, label40-2, label40-3, label40-4
Content of corresponding cell. The first number in the parameter name indicates the row and the second number stands for the column (numbered from left to right).

Magic words:

  • @hide: If there are only label cells defined in a given row and all of these are set to "@hide", the row is not shown regardless of other conditions or options.
Neutral
label1-1 tooltip up to label40-4 tooltip
Tooltip for corresponding cell, i.e. text which is displayed when a reader moves his/her mouse over the cell.
Neutral
(default: "2")
main image columns
Maximum amount of main images displayed per row. If the number of specified main images exceeds this value, a second (and if necessary, a third/fourth/fifth) row is created. For example, if main image columns is set to "3" and there are 2 main images, they will be displayed in one row; if there are 4 main images, the 4th image will be displayed in a second row.
Neutral
(default: "{{PAGENAME}}.jpg")
main image default
The file name (without "File:") which is suggested when uploading an image via the "upload image" button in the main image area. It is recommended to make this depend on {{PAGENAME}}.
Neutral
main image desc
Description for the main image area, displayed below the images.
Neutral
main image1 up to main image5
File name(s) of main image(s) (without "File:"), i.e. the images displayed directly below the infobox title. If more than one image is used, they are displayed in a configurable amount of rows (see main image columns) and their default sizes are adapted accordingly. If no main image has been specified, an "upload image" button will be displayed instead, prompting users to upload an image with a pre-defined file name (see main image default). options can be used to disable the "upload image" button.

Magic words:

  • @hide: If all defined main image parameters are set to "@hide", the main image area (or "upload image" button) is not shown regardless of other conditions or options.
Neutral
(default: "size main images/number of images")
main image1 size up to main image5 size
Size for corresponding main image. By default, this size depends on the number of specified main images and the amount of main image columns. If the combined width of all main images exceeds infobox width, images which are bigger than the default are reduced to default width.
Neutral
options
This parameter allows to specify options which apply to the infobox itself or all groups inside. Multiple options can be specified at once; simply separate them with commas (,).

Available choices:

  • collapsedgroups: This makes all groups within the infobox collapsible and collapsed on page load. Can be overriden for individual groups by setting the group-specific option parameter (see below) to "uncollapsed".
  • collapsiblegroups: This makes all groups within the infobox collapsible and uncollapsed on page load. Can be overriden for individual groups by setting the group-specific option parameter (see below) to "nocollapse".
  • imageoptional: If set, having no main image specified will not result in an "upload image" button being displayed.
Neutral
options0 up to options40
This parameter allows to specify options which apply to the corresponding group of rows. For example, options4 applies to all cells which belong to group4. Multiple options can be specified at once; simply separate them with commas (,). Group-specific options override options set for the whole infobox.

Available choices:

  • collapsible, nocollapse, uncollapsed: These options control the collapse behaviour of the group. They are mutually exclusive.
    • collapsed means the group is collapsible and collapsed on page load.
    • collapsible/uncollapsed mean the group is collapsible and uncollapsed on page load.
    • nocollapse means the group is not collapsible. This is the default setting.
Neutral
(default: "(width-10) x (width-10)px")
size images
Default size in pixels for images in image rows. If the specified width exceeds infobox width, the default width is used instead; if no height is specified, the default height is used instead.
Neutral
(default: "(width-10) x (width-10)px")
size main images
Size of main image area in pixels, i.e. the total space available for all main images. This is used as basis for calculating the default width of the individual main images. If the specified width exceeds infobox width, the default width is used instead; if no height is specified, the default height is used instead. main image# size overrides this default for the corresponding image.
Neutral
sort by
Sets the term the page is sorted under when displayed in categories ({{DEFAULTSORT:}}).
Neutral
subtitle
Text in small font below infobox title.
Neutral
supertitle
Text in small font above infobox title. Supertitles can be created dynamically by using the games parameter. For details, see supertitle link below.
Neutral
supertitle link
This parameter links the supertitle to an overview page (like Weapon). When used in conjunction with the games parameter, it can be used to dynamically create links to game-specific overview pages (like Fallout 3 weapons). For the exact behaviour please see {{abblink}}. This is useful if an infobox template is used for multiple games and you want it to link to the correct overview pages depending on which game it is used for. For example, setting supertitle to "weapon" and supertitle link to "weapons", you can then let the editor in the respective article specify the games parameter and it will link to the correct overview page (e.g. "Fallout 3 weapons" if the editor enters "FO3").
Neutral
(default: "{{Pagename nd}}")
title
Main title/"headline" of the infobox. By default, the name of the current page without any disambiguation suffixes (i.e. terms in brackets at the end) is used.
Neutral
(default: "250px")
width
Width of the infobox in pixels. In order to achieve a standardized look across all infoboxes, infoboxes should only be resized if absolutely necessary .

Style parameters[]

All style options should be used sparingly as they can lead to visual inconsistencies. Some examples of useful styles:

  • Changing background color: background-color: #123456; (accepts HTML color names or RGB hex triplets)
  • Changing (horizontal) text-alignment: text-align: center; (accepts "center", "justify", "left", "right")
  • Changing vertical text-alignment: vertical-align: middle; (accepts "bottom", "middle", "top")


Neutral
content1-1 style up to content40-4 style
Specifies CSS styles to apply to the corresponding content cell. For example, content10-3 style applies to the cell of content10-3 etc.
Neutral
footer style
Specifies CSS styles to apply to the footer cell.
Neutral
group1 style up to group40 style
Specifies CSS styles to apply to the corresponding group cell. For example, group6 style applies to the cell of group6 etc.
Neutral
icon style
Specifies CSS styles to apply to the icon.
Neutral
image1 style up to image40 style
Specifies CSS styles to apply to the cell with the corresponding image. For example, image9 style applies to the cell of image9 etc.
Neutral
label1-1 style up to label40-4 style
Specifies CSS styles to apply to the corresponding label cell. For example, label20-4 style applies to the cell of label20-4 etc.
Neutral
main image1 style up to main image5 style
Specifies CSS styles to apply to the corresponding main image. For example, main image3 style applies to main image3 etc.
Neutral
style
Specifies CSS styles to apply to every cell in the whole infobox except for the title cell.
Neutral
style0 up to style40
Specifies CSS styles to apply to all cells within the corresponding group of cells. For example, style3 applies to all cells which belong to group3 etc.
Neutral
style contents, style groups, style images, style labels, style main images
Specifies CSS styles to apply to all cells of a certain type. For example, style contents applies to all content cells and so forth.
Neutral
style contents0 up to style contents40, style images0 up to style images40, style labels0 up to style labels40
Specifies CSS styles to apply to a certain type of cells within the corresponding group of cells. For example, style contents5 applies to all content cells which belong to group5 etc.
Neutral
title style
Specifies CSS styles to apply to the title cell.

Examples[]

Simple[]

{{Infobox
|main image1        =Wiki.png
|main image1 size   =100x100px
|label1-1           =Label 1-1
|content1-2         =Content 1-2
|image2             =Wiki-wordmark.png
|label3-1           =Label 3-1
|content3-2         =Content 3-2
}}

Infobox with groups[]

{{Infobox
|main image1        =Wiki.png
|main image1 size   =100x100px
|group1             =Group 1
|label2-1           =Label 2-1
|content2-2         =Content 2-2
|group3             =Group 3
|label4-1           =Label 4-1
|content4-2         =Content 4-2
}}

Infobox with multiple columns[]

{{Infobox
|main image1        =Wiki.png
|main image1 size   =100x100px
|label1-1           =Label 1-1
|content1-2         =Content 1-2
|content1-3         =Content 1-3
|content1-4         =Content 1-4
|content2-1         =Content 2-1
|content2-3         =Content 2-3
}}

Infobox with collapsible groups[]

{{Infobox
|options            =collapsiblegroups
|main image1        =Wiki.png
|main image1 size   =100x100px
|group1             =Group 1
|label2-1           =Label 2-1
|content2-2         =Content 2-2
|group3             =Group 3
|label4-1           =Label 4-1
|content4-2         =Content 4-2
}}

Infobox with collapsible and non-collapsible groups[]

{{Infobox
|options            =collapsiblegroups
|main image1        =Wiki.png
|main image1 size   =100x100px
|group1             =Group 1
|label2-1           =Label 2-1
|content2-2         =Content 2-2
|group3             =Group 3
|options3           =nocollapse
|label4-1           =Label 4-1
|content4-2         =Content 4-2
}}

Infobox with multiple main images[]

{{Infobox
|options            =collapsiblegroups
|main image1        =Wiki.png
|main image2        =Wiki-wordmark.png
|main image3        =Wiki.png
|main image4        =Wiki-wordmark.png
|main image5        =Wiki.png
|label1-1           =Label 1-1
|content1-2         =Content 1-2
|label2-1           =Label 2-1
|content2-2         =Content 2-2
}}

Infobox with all main images in one row[]

{{Infobox
|options            =collapsiblegroups
|main image1        =Wiki.png
|main image2        =Wiki-wordmark.png
|main image3        =Wiki.png
|main image4        =Wiki-wordmark.png
|main image5        =Wiki.png
|main image columns =5
|label1-1           =Label 1-1
|content1-2         =Content 1-2
|label2-1           =Label 2-1
|content2-2         =Content 2-2
}}

Copy/paste[]

{{Infobox
|games              ={{{games|}}}
|title              ={{{name|}}}
|subtitle           ={{{subtitle|}}}
|supertitle         =
|supertitle link    =
|icon               ={{{icon|}}}
|icon offset        ={{{icon offset|}}}
|main image1        ={{{image|}}}
|main image1 size   ={{{image size|}}}
|main image2        ={{{image2|}}}
|main image2 size   ={{{image2 size|}}}
|main image3        ={{{image3|}}}
|main image3 size   ={{{image3 size|}}}
|main image4        ={{{image4|}}}
|main image4 size   ={{{image4 size|}}}
|main image5        ={{{image5|}}}
|main image5 size   ={{{image5 size|}}}
|main image desc    ={{{image desc|}}}
|footer             ={{{footer|}}}
|group1             =
|label1-1           =
|content1-2         ={{{|}}}
|group2             =
|label2-1           =
|content2-2         ={{{|}}}
|group3             =
|label3-1           =
|content3-2         ={{{|}}}
|group4             =
|label4-1           =
|content4-2         ={{{|}}}
|group5             =
|label5-1           =
|content5-2         ={{{|}}}
|group6             =
|label6-1           =
|content6-2         ={{{|}}}
|group7             =
|label7-1           =
|content7-2         ={{{|}}}
|group8             =
|label8-1           =
|content8-2         ={{{|}}}
|group9             =
|label9-1           =
|content9-2         ={{{|}}}
|group10            =
|label10-1          =
|content10-2        ={{{|}}}
|group11            =
|label11-1          =
|content11-2        ={{{|}}}
|group12            =
|label12-1          =
|content12-2        ={{{|}}}
|group13            =
|label13-1          =
|content13-2        ={{{|}}}
|group14            =
|label14-1          =
|content14-2        ={{{|}}}
|group15            =
|label15-1          =
|content15-2        ={{{|}}}
|group16            =
|label16-1          =
|content16-2        ={{{|}}}
|group17            =
|label17-1          =
|content17-2        ={{{|}}}
|group18            =
|label18-1          =
|content18-2        ={{{|}}}
|group19            =
|label19-1          =
|content19-2        ={{{|}}}
|group20            =
|label20-1          =
|content20-2        ={{{|}}}
|group21            =
|label21-1          =
|content21-2        ={{{|}}}
|group22            =
|label22-1          =
|content22-2        ={{{|}}}
|group23            =
|label23-1          =
|content23-2        ={{{|}}}
|group24            =
|label24-1          =
|content24-2        ={{{|}}}
|group25            =
|label25-1          =
|content25-2        ={{{|}}}
|group26            =
|label26-1          =
|content26-2        ={{{|}}}
|group27            =
|label27-1          =
|content27-2        ={{{|}}}
|group28            =
|label28-1          =
|content28-2        ={{{|}}}
|group29            =
|label29-1          =
|content29-2        ={{{|}}}
|group30            =
|label30-1          =
|content30-2        ={{{|}}}
|group31            =
|label31-1          =
|content31-2        ={{{|}}}
|group32            =
|label32-1          =
|content32-2        ={{{|}}}
|group33            =
|label33-1          =
|content33-2        ={{{|}}}
|group34            =
|label34-1          =
|content34-2        ={{{|}}}
|group35            =
|label35-1          =
|content35-2        ={{{|}}}
|group36            =
|label36-1          =
|content36-2        ={{{|}}}
|group37            =
|label37-1          =
|content37-2        ={{{|}}}
|group38            =
|label38-1          =
|content38-2        ={{{|}}}
|group39            =
|label39-1          =
|content39-2        ={{{|}}}
|group40            =
|label40-1          =
|content40-2        ={{{|}}}
}}

Technical[]

  • This template is fairly complicated. Editing it requires a good understanding of parser functions and wiki syntax.
  • Auxiliary templates:
    • {{Abb}}: Turns abbreviations into game names.
    • {{Abblink}}: Generates links to overview pages based on abbreviations.
    • {{Infobox/aux}}: Generates a "content"/"label" row.
    • {{Infobox/aux2}}: Generates "group" tables and header rows.
    • {{Infobox/aux3}}: Generates an "image" row.
  • Extensions used:
    • ImageSizeInfoFunctions
    • Variables
  • Standardized documentation for templates based on this one:
Advertisement