Help:Template: Difference between revisions
PinkYoshiFan (talk | contribs) (Created page with "{{Construction|if/switch, using other pages as templates}} {{Help}} '''Templates''' are special types of pages that can be put into other pages with extra parameters to modify them. ==Types of templates== *Category:Navigation templates are used to navigate between related pages, and are usually Module:navboxes. *Category:Formatting templates are used to simplify hard-to remember formatting, usually HTML attributes. *Category:Box templates are templ...") |
PinkYoshiFan (talk | contribs) m (actually switch is probably niche and complicated enough that it doesn't need to be covered here) |
||
Line 1: | Line 1: | ||
{{Construction|if | {{Construction|if, using other pages as templates}} | ||
{{Help}} | {{Help}} | ||
'''Templates''' are special types of pages that can be put into other pages with extra parameters to modify them. | '''Templates''' are special types of pages that can be put into other pages with extra parameters to modify them. |
Revision as of 16:42, 13 May 2022
Reason: if, using other pages as templates |
|
Templates are special types of pages that can be put into other pages with extra parameters to modify them.
Types of templates
- Navigation templates are used to navigate between related pages, and are usually navboxes.
- Formatting templates are used to simplify hard-to remember formatting, usually HTML attributes.
- Box templates are templates that use the Box template as a base.
- General wiki templates are templates used for various purposes, such as being used in other templates.
Basic templates
The most basic of templates are templates with no parameters, such as {{Welcome}}, which you can add to pages simply by putting the template name inside two curly brackets ({ and }) much like a link.
Templates with parameters
Templates with parameters are templates that can be modified to suit the page they are on. Parameters can be either numbers or words. On the template code, they are represented by putting the parameter name in three curly brackets. To use numbered parameters, simply put a pipe (|) after the template name within the brackets, and repeat for each number. To use word parameters, put parameter name=
after the pipe and before the parameter content (it is also possible, but not required, to do this with numbers). Most templates have a section at the bottom explaining the purpose of each parameter.
noinclude and includeonly
In order to avoid a mess of categorization and repeating template documentation every time they are called, noinclude and includeonly are used. <noinclude>
should be put immediately after the part to be included in the page (transcluded) ends. Text that should not show up on the template itself, but should show up on the page it is included on (usually categories), wrap it in <includeonly> </includeonly>
.