Template:InfoBox stack/testcases
From Gentoo Wiki
Jump to:navigation
Jump to:search
Note
This is the template test case page for Template:InfoBox stack and its sandbox version. You may have to to update the examples.
This is the template test case page for Template:InfoBox stack and its sandbox version. You may have to to update the examples.
Correct
Typical usage with one anonymous parameter: one specialized infobox with header
↑ 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
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
Sandbox version
↑ 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
Sandbox version
↑ 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
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Sandbox version
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Twenty anonymous parameters
Wiki code
{{InfoBox stack | {{InfoBox wikipedia|Gentoo|header=true}} | {{InfoBox wikipedia|Gentoo}} | {{InfoBox wikipedia|Gentoo}} | {{InfoBox wikipedia|Gentoo}} | {{InfoBox wikipedia|Gentoo}} | {{InfoBox wikipedia|Gentoo}} | {{InfoBox wikipedia|Gentoo}} | {{InfoBox wikipedia|Gentoo}} | {{InfoBox wikipedia|Gentoo}} | {{InfoBox wikipedia|Gentoo}} | {{InfoBox wikipedia|Gentoo}} | {{InfoBox wikipedia|Gentoo}} | {{InfoBox wikipedia|Gentoo}} | {{InfoBox wikipedia|Gentoo}} | {{InfoBox wikipedia|Gentoo}} | {{InfoBox wikipedia|Gentoo}} | {{InfoBox wikipedia|Gentoo}} | {{InfoBox wikipedia|Gentoo}} | {{InfoBox wikipedia|Gentoo}} | {{InfoBox wikipedia|Gentoo}} }}
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
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
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
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.