Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Help:Template
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===={{anchor|Parameters}} Examples with parameters==== An example of a template that takes parameters is the template {{tlx|about}}. Try typing {{tnull|about|how to use templates|how to use modules|Help:Lua}} in the sandbox—it will produce the following text: {{about|how to use templates|how to use modules|Help:Lua}} The template {{tlx|about}} uses three [[unnamed parameter]]s (also called positional parameters) in the example above, but you can call the same template with different numbers of parameters to give slightly different results, as explained in [[Template:About/doc|the template's documentation]]. For example, {{tnull|about||how to use modules|Help:Lua}}. Note the usage of an empty parameter—in this instance, the consecutive pipes mean that the first parameter specified is an empty string, which in this template will cause it to omit the initial "about" sentence. This produces: {{about||how to use modules|Help:Lua}} A simple example of a template that has named parameters is [[Template:Payoff matrix]], used to generate a 2-by-2 grid. For example: {{Markup|<nowiki>{{payoff matrix | UL = 5 | UR = 7 | DL = 2 | DR = 9 | Name = Example usage }}</nowiki>|{{payoff matrix | UL = 5 | UR = 7 | DL = 2 | DR = 9 | Name = Example usage }}}} See the [[Template:Payoff matrix|template page]] for more possibilities. Notice that the template is called here without specifying all its possible parameters, so undefined parameters are given default values.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)