Help:Template: Difference between revisions
m (hope to help here til next week) |
(→Usage: I'll finish here for today) |
||
Line 7: | Line 7: | ||
*[[:Category:Navigation Templates|Navigation Templates]] – These templates contain information linked directly or indirectly to a topic. A good example can be the {{tem|SMG}} template that shows all the elements shown in ''[[Super Mario Galaxy]]''. | *[[:Category:Navigation Templates|Navigation Templates]] – These templates contain information linked directly or indirectly to a topic. A good example can be the {{tem|SMG}} template that shows all the elements shown in ''[[Super Mario Galaxy]]''. | ||
*[[:Category:Notice Templates|Notice Templates]] – These templates serve to describe the current situation of a page. Arguably the most used templates found in this category are the {{tem|stub}} and {{tem|upcoming}} templates. That describes a page or article needs to be deeply developed and talks about a future project, like a new game, respectively. | *[[:Category:Notice Templates|Notice Templates]] – These templates serve to describe the current situation of a page. Arguably the most used templates found in this category are the {{tem|stub}} and {{tem|upcoming}} templates. That describes a page or article needs to be deeply developed and talks about a future project, like a new game, respectively. | ||
*[[:Category:Formatting Templates|Formatting Templates]] – These templates allow user to change parameters or add codes quickly by just adding them, and change the most essential values. Examples are the {{tem|color}} template to change the color of the text and {{tem|refneeded}} the add over a text that lacks a citation to make it valid. | |||
*[[:Category:Infobox Templates|Infobox Templates]] – These templates contain the essential information about a topic. Examples are {{tem|Character-infobox}} and {{tem|game-infobox}}. | |||
*[[:Category:Internal Link Templates|Internal Link Templates]] – Similar to Formatting Templates, but made for the links. | |||
*[[:Category:Media Templates|Media Templates]] – These templates serve to contain media such as images, videos and sound files, | |||
==Code== | ==Code== |
Revision as of 02:32, November 9, 2011
This article is under construction. Therefore, please excuse its informal appearance while it is being worked on. We hope to have it completed as soon as possible.
As in several wikis, the Super Mario Wiki provides templates that help the user to browse any information quickly and efficiently.
Usage
Most of the templates created here are a resource to help readers to get essential information from the text of an article and a quick means for the users whenever he or she is attempting to edit. The templates existing in this Wiki are classified in this way:
- Navigation Templates – These templates contain information linked directly or indirectly to a topic. A good example can be the {{SMG}} template that shows all the elements shown in Super Mario Galaxy.
- Notice Templates – These templates serve to describe the current situation of a page. Arguably the most used templates found in this category are the {{stub}} and {{upcoming}} templates. That describes a page or article needs to be deeply developed and talks about a future project, like a new game, respectively.
- Formatting Templates – These templates allow user to change parameters or add codes quickly by just adding them, and change the most essential values. Examples are the {{color}} template to change the color of the text and {{refneeded}} the add over a text that lacks a citation to make it valid.
- Infobox Templates – These templates contain the essential information about a topic. Examples are {{Character-infobox}} and {{game-infobox}}.
- Internal Link Templates – Similar to Formatting Templates, but made for the links.
- Media Templates – These templates serve to contain media such as images, videos and sound files,
Code
Make sure you know the MediaWiki syntax for a template:
- For an input, type {{{1}}} for the first input, {{{2}}} for the second, and so on.
- This can also be substituted with {{{value}}} or another name.
- For current page information, type {{NAMESPACE}} for the page's namespace, and {{PAGENAME}} for the page's name.
- These will be inserted and changed as the location of the template changes.
Make sure you know how to use the template once it's been created:
- If the template is in a Template: namespace, simply type {{its name}} to use it.
- If the template is in any other namespace, simply type {{Namespace:its name}} to use it.
- For an input, {{{1}}}, type {{its name|input 1|input 2|etc...}}.
- For an input, {{{value}}}, type {{its name|value = input 1}}.
To include text in the template that you don't want to show up in pages that use it, such as:
- Instructions on how to use the template
- A category to organize the template
Place the text in a set of <noinclude> tags at the bottom of the template page.
Substituting
For some templates, it is a better idea to take load off the server and use subst: before the template name. This substitutes the dynamic code on the page with static text. For example, {{tick}} will display as {{tick}} in the code, while {{subst:tick}} will display as [[File:wiki tick.GIF]] in the code.
Example
Here is a simple example, creating a signature for any user typing {{Sig|User}}:
- If the template contains the code:
[[User:{{{1}}}|{{{1}}}]] ([[User talk:{{{1}}}|talk]] · [[Special:Contributions/{{{1}}}|edits]])
- Typing {{Sig|user}} inserts this code:
[[User:User|User]] ([[User talk:User|talk]] · [[Special:Contributions/User|edits]])
- Which shows on the page as: