Welcome to SmashWiki! Log in or create an account and join the community, and don't forget to read this first! |
Notices |
---|
The Skill parameter has been removed from Smasher infoboxes, and in its place are the new "Best historical ranking" and "Best tournament result" parameters. SmashWiki needs help adding these new parameters to Smasher infoboxes, refer to the guidelines here for what should be included in these new parameters. |
When adding results to Smasher pages, include each tournament's entrant number in addition to the player's placement, and use the {{Trn}} template with the matching game specified. Please also fix old results on Smasher pages that do not abide to this standard. Refer to our Smasher article guidelines to see how results tables should be formatted. |
Check out our project page for ongoing projects that SmashWiki needs help with. |
Help:Templates: Difference between revisions
mNo edit summary |
m (→Linking) |
||
Line 18: | Line 18: | ||
*<nowiki>{{policy}}</nowiki> will insert that template into an article. | *<nowiki>{{policy}}</nowiki> will insert that template into an article. | ||
{{helpnav}} | |||
[[category:help|Templates]] | [[category:help|Templates]] | ||
[[category:Templates| ]] | [[category:Templates| ]] |
Revision as of 16:38, October 14, 2010
A template is a page, like its title says, a page which can be included into any other page, and sometimes be customized. This page gives tips on creating and using templates.
Creating templates
Templates in most cases, are very easy to create. They should have the prefix Template: (see Help:Namespaces), but it doesn't need to be included to other pages.
This template below is an example. It can be included in the current page by typing {{example}}. "Example" is the name of the template, and the two curly braces are used to include it:
The template was successfully included in this page.
Sometimes, you may want to write about the template on its page (often to explain how and when to use it), but you don't want this text to appear on the template itself. To do this, you should enclose such text with <noinclude> and </noinclude> so that it does not appear on every page you use the template on. An example can be found in the {{policy}} template. Below the box is a line of text that does not appear on policy pages. The opposite can also be made, by writing <noinclude> and </noinclude> tags around to only make text appear when included. This is very useful for categories.
Modifiers
Non-template namespace
By writing {{Namespace:Page name}}, pages from various namespaces can be included.
Substitution
Templates can be substituted by writing {{SUBST:Template name}}, {{SUBST:Namespace:Page name}} or {{SUBST::Page name}}. By writing {{SUBST:Example}}, the content on {{Example}} is placed on the page instead of just {{Example}} when someone edits.
Linking
To link to a template without inserting it, use brackets instead of curly braces.
- [[Template:Policy]] will link to Template:Policy
- {{policy}} will insert that template into an article.