Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 13:36, 5 February 2024 by Evon R'al (talk | contribs) (Rewrite to use {{Color box}} as meta template.)
An example!
Template documentation (for the above template, sometimes hidden or invisible)
Description
Produces a centered, colored box, which is used to present an example on a page.
Dependencies
Uses
{{Color box}}
Syntax
{{Example|<content>|<width= width>}}
Parameters
content
The example text inside the box. The box has "An example!" as the default text. If the text includes an equals sign (=), the text needs to be explicitly declared as a numbered parameter (i.e. put 1= before the text), otherwise the template will display the default text.
width
Sets the width of the box. It's recommended to set this as a percentage (of the paragraph width), so 50% will produce a text box half as wide as the surrounding paragraph. The default width is set at 95%. When width is set to less than 100%, the box will be centered.
Examples
{{Example|An example to ''illustrate'' my article with a link to the [[Venture]].}}
gives ...
An example to illustrate my article with a link to the Venture.


{{Example|How not to put the formula 2+2=4 into an example.}}
gives ...
An example!


{{Example|1= How to put the formula 2+2=4 into an example.}}
gives ...
How to put the formula 2+2=4 into an example.


See also
Template data
This is the TemplateData documentation for this template used by VisualEditor and other tools.

Box to present examples in articles. When the (optional) width is set to less then 100% the box will be centered.

Template parameters[Edit template data]

This template has custom formatting.

ParameterDescriptionTypeStatus
Content1

The content of the example box. If the text includes an equals sign (=), the text needs to be explicitly declared as a numbered parameter (i.e. put 1= before the text), otherwise the template will display the default text.

Default
An example!
Contentrequired
widthwidth

Set the width of the box. Preferably in %

Default
95%
Stringoptional
Visit Template:Example/doc to edit this text! (How does this work?) (Refresh this text - why?)