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
Serpent King (talk | contribs) (Will be a much more expanded version of Help:Templates, which I feel is severely lacking.) |
Serpent King (talk | contribs) |
||
Line 18: | Line 18: | ||
==Building templates== | ==Building templates== | ||
===Parameters=== | |||
===Conditionals=== | ===Conditionals=== | ||
===Expressions=== | ===Expressions=== |
Revision as of 19:41, January 22, 2016
Templates are tools used in our articles that serve to both provide consistency and simplify the editing process. They may be used to quickly and easily build tables or infoboxes, or they could be used as link shortcuts. For a list of usable templates, see Category:Templates.
Using templates
To use a template, the following syntax should be used: {{TemplateName}}
. This is called "transclusion". For example, to use the template {{example}}, one would insert {{example}} in the place where the template should be included. The result will be the contents of Template:Example:
The template was successfully included in this page.
Template parameters
Sometimes, a template will have required or optional parameters that need to be specified on the template's use. There are 2 methods of supplying parameters (which one should be used depends on the template in question):
- Supplying parameters in a unnamed list. This is typically done with templates that have only 1 or 2 parameters, such as {{SSB}}. To do this, simply add a bar ("|") after the template name, followed by the parameter's contents. This is to follow a {{TemplateName|Param1|Param2|Param3...}} format.
- Example: {{SSB|Mario}} returns Mario
- Supplying named parameters. This is usually used with templates the supply many parameters, such as {{Head}}. To do this, still add the bar, but instead of inserting the parameter's contents right away, add the parameter name (specified by the template) followed by an equals sign ("="), then the parameter's contents.