12,169
edits→Template documentation
(4 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
{{hatnote|This article is a technical guide to the creation of templates on BG3Wiki. For a guide on how to use templates, see [[Help:Using templates]]. See [[Help:List of templates]] for a list of templates.}} | {{hatnote|This article is a technical guide to the creation of templates on BG3Wiki. For a guide on how to use templates, see [[Help:Using templates]]. See [[Help:List of templates]] for a list of templates.}} | ||
{{NavWiki|help}} | {{NavWiki|help}} | ||
A template is a special type of page designed to be transcluded within other pages. Templates allow editors to automatically insert frequently-used images, code, and formatting on a page. | A '''template''' is a special type of page designed to be transcluded within other pages. Templates allow editors to automatically insert frequently-used images, code, and formatting on a page. | ||
To ensure standardised practices across the wiki, this page provides guidelines for the process of '''template creation'''. | To ensure standardised practices across the wiki, this page provides guidelines for the process of '''template creation'''. | ||
Line 35: | Line 35: | ||
=== Shortcuts === | === Shortcuts === | ||
To make templates easier to use, each template should have 1-5 ''shortcuts'', added with {{t | To make templates easier to use, each template should have 1-5 ''shortcuts'', added with {{t link|shortcut}}. These are redirects which have shorter names for ease of access. These do not need to follow the template page naming conventions. | ||
As few shortcuts as possible should be created in order to prevent ambiguity. It a single shortcut is sufficient, then additional shortcuts {{em|should not}} be created. | As few shortcuts as possible should be created in order to prevent ambiguity. It a single shortcut is sufficient, then additional shortcuts {{em|should not}} be created. | ||
Line 47: | Line 47: | ||
; Examples of shortcuts | ; Examples of shortcuts | ||
* {{t link|t link}}, redirects to {{t link|template link}} | * {{t link|t link}}, redirects to {{t link|template link}} | ||
* {{t link|cw}}, redirects to {{t link|content warning}} | * {{t link|cw}}, redirects to {{t link|content warning}} | ||
Line 82: | Line 81: | ||
Template documentation should ideally include the following: | Template documentation should ideally include the following: | ||
* A description of what the template does. | * A description of what the template does. | ||
* Examples of the template in use, either using {{t link| | * Examples of the template in use, either using {{t link|template demo}}, {{t link|c}} and / or <nowiki><pre></pre></nowiki> tags. | ||
* Clear descriptions of the template's parameters. | * Clear descriptions of the template's parameters. | ||
* Links to similar or relevant templates. | * Links to similar or relevant templates. |