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:A quick guide to templates
(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!
==Creating, editing, and using templates== You can start a new template in the same way that you would [[Wikipedia:Starting an article|start an article page]]. The only difference is that its title must start with <code>Template:</code>. Once you have made the template—for example ''Template:foo''—you can add <code><nowiki>{{</nowiki>''foo''<nowiki>}}</nowiki></code> to the pages that you want to use it on. Every page using this template uses the same [[boilerplate (text)|boilerplate]] text each time that a user visits it. When the template is updated, all pages containing the template tag are automatically updated. Alternatively, if you do not wish the page to reflect future updates to the template, you can add <code><nowiki>{{</nowiki>subst:''foo''<nowiki>}}</nowiki></code> to the pages on which you want to use the boilerplate text. The system fetches a one-time copy of the template text and '''[[Wikipedia:Substitution|substitutes]]''' it into the page in place of the template tag. If anyone edits the template afterwards, pages that used the <code>subst:</code> keyword do '''not update'''. Sometimes that is what you want. If the template that you want to edit looks like <code><nowiki>{{foo}}</nowiki></code>, you would go to Template:foo to edit it. To get there, type "Template:foo" in the search box (see [[Help:Searching|search]]), or make a wikilink like <code><nowiki>[[Template:foo]]</nowiki></code> somewhere, such as in the [[{{ns:4}}:sandbox|sandbox]], and click on it. Once you are there, just click "edit" or "edit this page" at the very top of the page (not the documentation edit button lower down) and edit it in the same way that you would any other page. You can add anything that you would add to a normal page, including text, images, and other templates. When editing templates that are in use, it is a good idea to do so in a sandbox, as described in the [[Wikipedia:template sandbox and test cases|template sandbox and test cases]] how-to guide. ===Parameters=== Templates can have parameters which the page can dynamically incorporate into the transcluded page. Instead of just the template name, like <code><nowiki>{{foo}}</nowiki></code>, an embedded template tag would have additional values separated by [[vertical bar]]s (|), e.g. <code><nowiki>{{foo|July|lc=yes}}</nowiki></code>. Here <code>July</code> is the value of the first unnamed parameter; <code>yes</code> is the value of the named parameter <code>lc</code>. Writing the template page for a template with parameters is more complicated than for a template with no parameters. See [[Help:Template]]. ===Editing existing templates=== When you edit a template that is in use, it can affect many pages throughout Wikipedia all at once. {{slink|Wikipedia:Template editor|Use}} has tips to help avoid problems.
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)