Template:InfoBox stack/testcases

From Gentoo Wiki
Jump to: navigation, search
Note
This is the template test case page for Template:InfoBox stack and its sandbox version. You may have to purge this page to update the examples.

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.