Template:InfoBox stack

From Gentoo Wiki
Jump to: navigation, search
[edit

Documentation

Note
This page is a template. It contains some standardized, often used text, which can be transcluded inside other pages.

As this template is widely used in our wiki, it may be protected in which case only staff members can change it. Use the discussion page to propose enhancements or fixes, or to voice your opinion.

Use this template to display a "stack" of one or more right-floated infoboxes on a page.

To link to this stack use #infobox-stack.

Parameters

Parameter name Required? Default value Description
Anonymous parameter 1 Yes (n/a) First infobox template call; use that template's header parameter to show a heading at the top (see explanation below).
Anonymous parameter 2 No (n/a) Second infobox template call.
Anonymous parameter 3 No (n/a) And so forth. There can be up to 10.

Note that while this template itself understands only anonymous parameters, the various infobox templates (listed below) that are designed to be called inside of an {{InfoBox stack}} understand various named parameters (including header), as explained in their documentation.

Typically only the first infobox template in a stack will use a header parameter to display a heading. Occasionally there may be need for a second header midway through the stack; see the usage examples below for details.

Usage

{{InfoBox stack
| {{InfoBox 1}}
| {{InfoBox 2}}
...
}}

See the template's testcases:

Correct

Typical usage with one anonymous parameter: one specialized infobox with header
Wiki code
{{InfoBox stack
| {{InfoBox homepage|http://www.samba.org|header=true}}
}}
Main version
Resources
Sandbox version
Resources


↑ Note that because the header parameter is inside the call to {{InfoBox homepage}}, it is not "seen" by {{InfoBox stack}} (which doesn't know anything about headers).


Typical usage with multiple anonymous parameters: multiple specialized infoboxes with one header
Wiki code
{{InfoBox stack
| {{InfoBox homepage|http://www.samba.org|header=true}}
| {{InfoBox wikipedia|Samba (software)}}
| {{InfoBox guide|Samba}}
}}
Main version
Resources
Sandbox version
Resources


Less common: showing multiple predetermined headings (multiple anonymous parameters)
Wiki code
{{InfoBox stack
| {{InfoBox homepage|http://www.samba.org|header=true}}
| {{InfoBox wikipedia|Samba (software)}}
| {{InfoBox todo|Write a guide|header=true}}
}}
Main version
Resources
Article status
This article has some todo items:
  • Write a guide
Sandbox version
Resources
Article status
This article has some todo items:
  • Write a guide


↑ The second heading must be different from the first (otherwise why show it?), thus the infobox containing the second header parameter must be of a different type than the first. The types of infobox templates and the headings they provide are listed below.


Rarely needed: including a custom heading using {{InfoBox header}} (multiple anonymous parameters)
Wiki code
{{InfoBox stack
| {{InfoBox homepage|http://www.samba.org|header=true}}
| {{InfoBox wikipedia|Samba (software)}}
| {{InfoBox header|Custom heading}}
| {{InfoBox|info=Something new}}
}}
Main version
Resources
Custom heading
Something new
Sandbox version
Resources
Custom heading
Something new


↑ The generic templates {{InfoBox header}} and {{InfoBox}} can be used to create a customized heading and infobox inside a stack, as shown here — but if something like this seems necessary in an article (in the main namespace), it probably means that a new specialized {{InfoBox something}} template should be created instead. (In fact, all the existing specialized infobox templates are implemented using calls to these two generic templates.)


Generic infobox with generic heading (one anonymous parameter)
Wiki code
{{InfoBox stack
| {{InfoBox|info=An infobox|header=Heading text}}
}}
Main version

Heading text

An infobox
Sandbox version

Heading text

An infobox


↑ Note that a header parameter inside a call to {{InfoBox}} is used to specify the complete code that generates the heading (i.e., plain text input will not formatted in any special way). See that template's documentation for more information.


Generic infobox with standard heading (one anonymous parameter)
Wiki code
{{InfoBox stack
| {{InfoBox|info=An infobox| header={{InfoBox header|Heading text}} }}
}}
Main version
Heading text
An infobox
Sandbox version
Heading text
An infobox


↑ Here the header parameter (in the {{InfoBox}} call) gets its value from the output of {{InfoBox header}}, which marks up its input in a standard way that fits in with the overall color scheme of this wiki. This is how header should be implemented on any new special infobox that gets created.


Maximum of 10 anonymous parameters
Wiki code
{{InfoBox stack
| {{InfoBox|info=#1}}
| {{InfoBox|info=#2}}
| ...
| {{InfoBox|info=#10}}
}}
Main version
  1. 1
  1. 2
  1. 3
  1. 4
  1. 5
  1. 6
  1. 7
  1. 8
  1. 9
  1. 10
Sandbox version
  1. 1
  1. 2
  1. 3
  1. 4
  1. 5
  1. 6
  1. 7
  1. 8
  1. 9
  1. 10


Incorrect

More than 10 anonymous parameters (error message)
Wiki code
{{InfoBox stack
| {{InfoBox|info=#1}}
| {{InfoBox|info=#2}}
| ...
| {{InfoBox|info=#11}}
}}
Main version
{{InfoBox stack template error}}
Too many anonymous parameters. Maximum is 11. For correct usage see InfoBox stack template's documentation on the 11 parameter.
Sandbox version
{{InfoBox stack template error}}
Too many anonymous parameters. Maximum is 11. For correct usage see InfoBox stack template's documentation on the 11 parameter.


No parameter (error message)
Wiki code
{{InfoBox stack}}
Main version
{{InfoBox stack template error}}
Parameter 1 not defined. For correct usage see InfoBox stack template's documentation on the 1 parameter.
Sandbox version
{{InfoBox stack template error}}
Parameter 1 not defined. For correct usage see InfoBox stack template's documentation on the 1 parameter.


See also[edit]

The templates below are implemented using {{InfoBox}}. They should also appear in Category:InfoBox templates, which may be more complete than this list.

These templates should be used within an {{InfoBox stack}}. Each should provide its own header parameter, but if necessary {{InfoBox header}} can be used.

Underlined text indicates the default heading provided by header=true for each type of template.

For use in articles
Resources
Article status
For use on talk pages
Talk status
(Note that the simpler {{Talk}} can be used in place of both of these.)
For use on user pages
User info
Babel (spoken-language indicators)
Note
The above documentation is transcluded from Template:InfoBox stack/doc. (edit | history)
Editors can experiment in this template's sandbox (edit) and testcases (edit) pages.
Please add categories and interwikis to the /doc subpage. (See the subpages of this template.)