Content deleted Content added
Palosirkka (talk | contribs) link documentation |
that’s a directory now |
||
(13 intermediate revisions by 11 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
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.
Template pages are found in the [[Wikipedia:Template namespace|template namespace]]. This means any page whose title begins with "Template:", such as "[[Template:foo]]", can be used for that purpose. The content from a template titled Template:foo can be added into a Wikipedia page by editing a page and typing <code><nowiki>{{foo}}</nowiki></code> into it. When then viewing the page, <code><nowiki>{{foo}}</nowiki></code> is automatically replaced by the content of the page "Template:foo". If the page "Template:foo" is later altered, all the pages with <code><nowiki>{{foo}}</nowiki></code> in them will change automatically.
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
===Parameters===
Line 41 ⟶ 42:
==FAQ==
: To see the documentation for the template whose name is "foo", go to "Template:foo".
: To list all pages onto which a template is transcluded, use '''[[Special:WhatLinksHere]]''' and type in template:''templatename'' ([[Help:What links here|more info]]).
: No, if you want to use it on two different language Wikipedias, for example, you would need to create it twice.
: Yes, except usually (on most wikis)<sup>[[meta:Help:Template#Case sensitivity|[1]]]</sup> the first letter.
: See [[Help:Template]] for instructions.
: Wikipedia and your computer both store webpage ''[[Web cache|caches]]'' – or saved copies – and don't always show you an updated page. First, try to [[WP:BYPASS|bypass your browser's cache]] by pressing
: Yes, this works in exactly the same way as normal [[Help:Moving a page|page moves]]. When a page called for inclusion is a redirect page, the redirect target is included instead.
: Yes.
: You start a new template in the same way you would start a normal page. The only difference is that its title must start with {{code|Template:}}. Don't forget to document it so that other editors can use it!
: The language inside templates is the same language as regular wiki markup, but template writers tend to use the more complex available functions such as #if: statements. See Wikipedia's [[Help:Template]] and Wikimedia's [[mw:Help:Template]], including all of "advanced functioning" help pages listed toward the bottom of [[mw:Help:Template#Links to other help pages|that page]].
Line 81 ⟶ 82:
*[[Help:Template]] (more details)
*[[m:Help:Templates]] (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}}
|