Help:Template: Difference between revisions
mNo edit summary |
(seems to have the basics of template use covered; actual template building is something you gotta see in action, and/or look to wikipedia's manuals for) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
As in several wikis, the Super Mario Wiki provides templates that help the user to browse any information quickly and efficiently. See also [[MarioWiki:Navigation Templates]] and [[MarioWiki:Notice Templates]] for more in-depth information about these two major groups of templates. | As in several wikis, the Super Mario Wiki provides templates that help the user to browse any information quickly and efficiently. See also [[MarioWiki:Navigation Templates]] and [[MarioWiki:Notice Templates]] for more in-depth information about these two major groups of templates. | ||
Line 29: | Line 28: | ||
If the template is in any other namespace, simply type <tt><nowiki>{{namespace:Name of template}}</nowiki></tt> to use it. | If the template is in any other namespace, simply type <tt><nowiki>{{namespace:Name of template}}</nowiki></tt> to use it. | ||
If the template has inputs, type <tt><nowiki>{{Name of template|write here to change the | If the template has inputs, type <tt><nowiki>{{Name of template|write here to change the fist parameter of a template|write here to change the second one}}</nowiki></tt> | ||
If the template has specified inputs, type <tt><nowiki>{{Name of template|name=The name of something}}</nowiki></tt> | If the template has specified inputs, type <tt><nowiki>{{Name of template|name=The name of something}}</nowiki></tt> | ||
===Substituting=== | ===Substituting=== | ||
In some cases involving more complex coding and template functions, '''subst:''' must be placed before the template name. This substitutes the dynamic code on the page with static text (i.e. the content within the template is pasted on the other page, rather than the template itself). For example, <tt><nowiki>{{tick}}</nowiki></tt> will display as <tt><nowiki>{{tick}}</nowiki></tt> in the code, while <tt><nowiki>{{subst:tick}}</nowiki></tt> will display as <tt><nowiki>[[File:wiki tick.GIF]]</nowiki></tt> in the code, which is what is contained in the <nowiki>{{tick}}</nowiki> template. | |||
==Example== | ==Example== | ||
Line 50: | Line 49: | ||
*[[MarioWiki:Navigation Templates]] | *[[MarioWiki:Navigation Templates]] | ||
*[[MarioWiki:Notice Templates]] | *[[MarioWiki:Notice Templates]] | ||
*[[Wikipedia:Help:Template]] | |||
{{BoxTop}} | {{BoxTop}} | ||
{{Wikipolicy}} | {{Wikipolicy}} | ||
[[Category:Help|{{PAGENAME}}]] | [[Category:Help|{{PAGENAME}}]] | ||
{{Shortcut|MW:TEMPLATE}} | {{Shortcut|MW:TEMPLATE}} |
Revision as of 16:54, September 26, 2015
As in several wikis, the Super Mario Wiki provides templates that help the user to browse any information quickly and efficiently. See also MarioWiki:Navigation Templates and MarioWiki:Notice Templates for more in-depth information about these two major groups of templates.
Usage
To understand their usage, the templates existing in this Wiki are classified in this way:
- Navigation Templates – These templates has links that are directly or indirectly related to a topic. A good example can be the {{SMG}} template that shows all the elements related to the game Super Mario Galaxy.
- Notice Templates – These templates serve to notice readers the current state of a page. Arguably the most used templates found in this category are the {{stub}} and {{upcoming}} templates. The first describes a page or article needs to be deeply developed and the latter talks about a future project, like a new game.
- Formatting Templates – These templates allow users to change elements of a page quickly by just adding them. 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 the topic of an article. Examples are {{Character-infobox}} and {{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 audio files.
- Project Templates – These templates are made for the internal projects of this Wiki, for example The 'Shroom and the Pipe Plaza.
- Userbox Templates – These templates are decorative tables to describe our users in the Mariowiki. Used only for your userpages.
- Image Maps – These templates has an image with links. By cliking on an linked area of the image, the user will be sent to the article in question.
Code
Make sure you know the MediaWiki syntax for a template:
To create a template, it's needed to put the title starting Template and then the name of the template. Example: Template:Name of template
Add the content you want to show for the template in the edit area. To insert an input, type {{{1}}} for the first input, {{{2}}} for the second, and so on. You can also specify the input by inserting a name like this {{{name}}}.
Once you've finished, it's possible that you have to use the coding <includeonly> </includeonly> to tag the content of the template that will be shown and <noinclude> </noinclude> to tag the rest that shouldn't. The Noinclude tag usually covers the usage instructions of the template and the template's category.
To embed a template, simply type {{Name of template}} in a page.
If the template is in any other namespace, simply type {{namespace:Name of template}} to use it.
If the template has inputs, type {{Name of template|write here to change the fist parameter of a template|write here to change the second one}}
If the template has specified inputs, type {{Name of template|name=The name of something}}
Substituting
In some cases involving more complex coding and template functions, subst: must be placed before the template name. This substitutes the dynamic code on the page with static text (i.e. the content within the template is pasted on the other page, rather than the template itself). For example, {{tick}} will display as {{tick}} in the code, while {{subst:tick}} will display as [[File:wiki tick.GIF]] in the code, which is what is contained in the {{tick}} template.
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: