Help:Templates: Difference between revisions

Jump to navigation Jump to search
1,195 bytes added ,  1 December 2023
→‎Template creation: add a section of directives
(→‎Template creation: add a section of directives)
Line 29: Line 29:
=== Cargo database ===
=== Cargo database ===
Templates also allow the wiki to populate database tables with stored values using [[https://m.mediawiki.org/wiki/Extension:Cargo Cargo queries]. This allows the wiki to create automatically generated lists of items or spells.
Templates also allow the wiki to populate database tables with stored values using [[https://m.mediawiki.org/wiki/Extension:Cargo Cargo queries]. This allows the wiki to create automatically generated lists of items or spells.
=== Formatting ===
* Templates '''must''' have "template data", achieved by clicking "Manage template data" at the top of the page. This enables templates to be used by visual editors.
** The template data '''must''' be on the template's main page if it does not have a doc subpage. It '''must''' be on the template's doc subpage if it does have one.
* Templates '''should''' have documentation that includes at least one example of its usage.
* Templates '''should''' use {{c|<nowiki>{{documentation|content=}}</nowiki>}} for all of its documentation.
** Long documentation '''may''' be moved to a {{c|/doc}} subpage. In this case, use {{c|<nowiki>{{documentation}}</nowiki>}} on the main page instead.
* Templates '''must''' have categories. At the bare minimum, it should be categorized as [[:Category:Templates]] or one of its subcategories.
** The categories '''should''' be located on the doc subpage, if it exists. The doc subpage '''must''' use {{c|<nowiki><noinclude></nowiki>}} tags around categories, otherwise the subpage will be counted as a template in the category index.
* Cargo declare '''must''' be in a noinclude on the template's main page, even if there is a doc subpage.


== Additional resources==
== Additional resources==

Navigation menu