Help:A quick guide to templates: Difference between revisions

Content deleted Content added
m FAQ: clarify
that’s a directory now
(9 intermediate revisions by 8 users not shown)
Line 1:
{{Short description|Wikimedia project page or help page}}
{{pp-semi-indef|small=yes}}
{{pp-move-indef|small=yes}}
{{Wikipedia how to|H:TQG|sort-by=Templates, A quick guide to}}{{Wiki markup}}
This is a quick '''overview of templates'''. Full details can be found in '''[[Help:Template]]''', '''[[Wikipedia:Templates]]''' and '''[[mw:Manual:Advanced_templates|m:HelpManual:Advanced templates]]'''.
 
A '''template''' is a Wikipedia page created to be included in other pages. It usually contains repetitive material that may need to show up on multiple articles or pages, often with customizable input. Templates sometimes use [[MediaWiki]] parser functions, nicknamed "[[Help:Magic words|magic words]]", a simple [[scripting language]].
Line 12 ⟶ 13:
When a template is automatically expanded and appears on a page, it is said to be "[[Wikipedia:Transclusion|transcluded]]".
 
[[Wikipedia:Template documentation|Templates are documented]] (or should be) at their pages. Thus if you want to know how to use a template whose name is "foo" (perhaps because you've seen <code><nowiki>{{foo|...}}</nowiki></code> in the source of an article), then go to "Template:foo". (The documentation itself will usually be located at "Template:foo/doc", but is also transcluded onto the "Template:foo" main page).)
 
==Creating, editing, and using templates==
Line 23 ⟶ 24:
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 usedin use, it is suggesteda good idea to usedo so in a sandboxessandbox, as described in the [[Wikipedia:template sandbox and test cases|template sandbox and test cases]] how-to guide.
 
===Parameters===
Line 51 ⟶ 52:
 
; Are template names case-sensitive?
: Yes, except usually (on most wikis)<sup>[[meta:Help:Template#Case sensitivity|[1]]]</sup>) the first letter.
 
; How can I add parameters?
Line 57 ⟶ 58:
 
; I edited the template, so why didn't the page it is used on change?
: Wikipedia and your computer both store webpage ''[[Web cache|caches]]''&nbsp;– or saved copies&nbsp;– and don't always show you an updated page. First, try to [[WP:BYPASS|bypass your browser's cache]] by pressing ⌘R{{key press|Opt|Cmd|R}}, {{key press|Ctrl+|Shift|R}}, or {{key press|Ctrl|F5}}. If that fails, you may need to [[WP:PURGE|purge]] the page's cache (which can be done several different ways). Perhaps the easiest way to do this is by clicking '''edit''' on the page in which the template appears, and then clicking on '''Publish changes''' without having changed anything&nbsp;– there is no need to fill in the ''Summary'' field since there will not be any ''history'' of this as a change generated.
 
; Can I move a template to a new name?
Line 81 ⟶ 82:
*[[Help:Template]] (more details)
*[[m:Help:Templates]] (details from [[Wikimedia]])
*[[mmw:HelpManual:Advanced templates]] (advanced details from Wikimedia)
*[[Wikipedia:Template namespace]] (the usual [[Wikipedia:Namespace|namespace]] for templates)
*[[Wikipedia:Transclusion]] (transcluding templates)
Line 89 ⟶ 90:
{{Help navigation}}
{{Wikipedia technical help|collapsed}}
 
{{DEFAULTSORT:Quick guide to templates, A}}