Template:Infobox/Base/doc

From 2d4chan
Jump to navigation Jump to search

Infoboxes are informational summaries of an article's key points. Template:Tl allows you to create infoboxes that follow a standard appearance and style with minimal markup. This template is not meant to be used directly, but instead be used by more specific infobox templates.

Usage[edit source]

{{Infobox/Base
| ibname     = 
| ibtype     = 
| traits     = 
| image      = 
| imagebgcolor = 
| website    = 
| pubcode    = 

| ibclass    = 
| bgcolor    = 
| fgcolor    = 

| paramname1 = 
| param1     = 
...

| source      = {{{source|}}}
| page        = {{{page|}}}
| footnote    = {{{footnote|}}}
}}

All of Template:Tl's parameters are optional, and except for name do not appear if not passed or are passed with an empty parameter. Most uses of Template:Tles should be in templates that pass the necessary parameters to Template:Tl. See the examples below for more details.

Title and type metadata[edit source]

ibname
The name that appears at the top of the infobox.
Default: Template:Xt
ibtype
The type of content this infobox summarizes. This is wrapped in parentheses in the rendered infobox.
image
An image link that illustrates the article's subject. Should be given without [[]] or any settings.
website
A link associated with the article. This typically appears beneath the image.
pubcode
The stock code associated with a product. This typically replaces the default text of the website link.

Style attributes[edit source]

imagebgcolor
A CSS color code for the background of the image parameter.
Default: Template:Xt
ibclass
The name of a CSS class to associate with the infobox. Template:Xt and Template:Xt are always assigned; any classes added here are added to the infobox and do not override these classes.
bgcolor
A CSS color code for the background of the ibname and ibtype parameters.
Default: Template:Xt
fgcolor
A CSS color code for the text of the ibname and ibtype parameters.
Default: Template:Xt

Parameters[edit source]

paramnamen
The name of a parameter in the infobox, presented in order from top to bottom in the infobox's body. This text is bolded in the left column of the infobox's body. You can include as many paramnamen entries as you wish, but each should be accompanied by a paramn of the same number.
Certain paramnames have special properties:
artworkby, imagesof, gallery, worksby: Links the param to a category, either Template:Xt for artwork by creator, Template:Xt for artwork categorized by subject, Template:Xt for artwork categorized by source, or Template:Xt for published works by creator, respectively. Only the param is displayed, only one of these two options should be used, and only one instance of it should be used per infobox.
Default, if no param is provided: Template:Xt
custom: Renders arbitrary wikitext instead of a key/value pair. The same optional customclass and customstyle values are applied to all custom parameter containers.
isbn, ISBN, isbne, ISBNE: Precedes the content with "ISBN", triggering special handling of a valid ISBN param.
regionmap: An image with no preceding text, designed to display a regional map for a location. Only the regionmap's param content is displayed.
source: Italicized source spanning the infobox body, preceded by a horizontal line and "Source:" and suffixed by a page number if the page parameter is provided. Only the source's param content is displayed, only one source should be used per infobox, and the source should be the last paramname/param in the infobox.
paramn
The content of the associated parameter, typically displayed as plain text in the right column of the infobox's body unless noted otherwise above.
page
A page number for a provided source paramnamen. page only appears if there is a source.
footnote
An additional footnote for the bottom of the infobox. A common use case for the footnote parameter is to denote information that differs between multiple books about the subject. For example, dhampir creatures have the common trait in Monster Core, but dhampir player characters have the Template:2eTrait trait in Player Core 2. Changes that occurred in the Pathfinder Remaster project might label legacy content as follows: "Legacy 2E: In Core Rulebook 409, awaken animal additionally had the Template:2eTrait trait."
1E,2E
If present this will create a tabbed 1E/2E section in the infobox.
aon1e,aon2e
Can contain a link to an Archive of Nethys page, starting after the first slash (e.g. Monsters.aspx?ID=490)

Example[edit source]

Subject template example[edit source]

You can create an infobox template that itself calls Template:Tl. Indeed, this is the preferred way to use Template:Tl—you can create an infobox that employs a reusable, standard set of parameters for a common subject without needing to use complex wiki code or HTML.

Infobox/Base/doc


(City)

{{ #forargs: paramname

 | key
 | value
 | 

}}{{ #forargs: paramname

 | key
 | value
 | 

}}

{{Infobox
| ibname     = {{{name|}}}
| ibtype     = City
| image      = {{{image|}}}

| bgcolor    = #363
| fgcolor    = #fff

| paramname1 = Titles
| param1     = {{{titles|}}}

| paramname2 = Nation
| param2     = {{{nation|}}}

| paramname3 = Region
| param3     = {{{region|}}}

| paramname4 = Size
| param4     = {{{size|}}}

| paramname5 = Population
| param5     = {{{population|}}}

| paramname6 = Demographics
| param6     = {{{demographics|}}}

| paramname7 = Government
| param7     = {{{government|}}}

| paramname8 = Alignment
| param8     = {{{alignment|}}}

| paramname9 = Demonym
| param9     = {{{natives|}}}

| paramname10 = Adjective
| param10     = {{{adjective|}}}

| paramname11 = Ruler
| param11     = {{{ruler|}}}

| paramname12 = Leader
| param12     = {{{leader|}}}

| paramname13 = regionmap
| param13     = {{{regionmap|}}}

| paramname14 = source
| param14     = {{{source|}}}
| page        = {{{page|}}}
}}

The above example is Template:Tl. See that template's documentation for details on its usage. Template:Tl passes its content to Template:Tl through its own defined parameters.

When creating an infobox template using Template:Tl, you can make a parameter always appear by adding a fallback value. For example, to make the region parameter above a required or always-appearing parameter, change its param from Template:Xt to Template:Xt.

Raw infobox example[edit source]

Example arbitrary infobox


(Example)

{{ #forargs: paramname

 | key
 | value
 | 

}}{{ #forargs: paramname

 | key
 | value
 | 

}}

You can also create arbitrary, one-off infoboxes by directly invoking Template:Tl.

{{Infobox/Base
| ibname  = Example arbitrary infobox
| ibtype  = Example

| bgcolor = #FFF
| fgcolor = #000

| paramname1 = First
| param1     = This text appears first

| paramname2 = Second
| param2     = This text appears second

| paramname3 = artworkby
| param3     = Wayne Reynolds

| paramname4 = custom
| param4     = [https://google.com Google link]
| customclass = plainlinks
| customstyle = font-size: 0.8em; text-style: italic; text-align: center;

| paramname5 = source
| param5     = [[Core Rulebook]]
| page       = 1

| paramname6 = footnote
| param6     = footnote
}}