Feed The Beast Wiki:Template guideline

From Feed The Beast Wiki
Jump to: navigation, search

Templates are powerful tools for simplifying many tasks, organizing work, standardizing content, and otherwise improving the wiki. However, they also have potential drawbacks and limitations which should be kept in mind when developing new templates and using existing ones. Please follow the guidelines listed below when creating and editing templates, not following these guidelines may result in a temporary block and in more severe cases a permanent block.

Problems and questions[edit source]

Templates (and Scribunto modules, which some of them may use) on this wiki are maintained by the community, all questions and issues regarding templates may be directed to the specific template or module's talk page or the centralized discussion board.

Read this before making any changes to templates[edit source]

Some templates are widely used across the wiki, please be aware of what you are doing when you are editing these templates; breaking such templates may result in a temp-block. If you do not know what a template is for, then please do not edit that template.

Creating templates[edit source]

Before creating any templates, please make sure that no template similar to yours exists. A full list with a brief description can be found on the wiki. Please also test your templates on the Template sandboxes to make sure your concept works.

When creating templates, please make your code as easy to understand as possible. Please also include a reason for the template to exist in the edit summary or documentation page (/doc). Documentation is required for every template (see Documenting templates). To include the documentation in the template page, add <noinclude><code>{{Documentation}}</noinclude></code> on the last line of your template. Make sure not to put it on a new line, or the new line may be included in the template itself. Some templates have shared documentation so it is advised to check similar templates before creating your own documentation.

After creating the template, please update the list of templates with your new template with an accompanying description.

Editing templates[edit source]

When editing templates, please make sure that all brackets are balanced, use the preview feature (removing <includeonly> tags when needed) whenever it is possible. When editing templates that are used widely across the wiki or making changes that greatly modifies the behavior of the template, please test the template with the template sandboxes first; please also discuss changes on the talk page before making such changes. Please always include what modification you made and why in the edit summary when editing templates.

If your change add or removes parameters, changes the behavior of the template, you must also update the template documentation. When modifying a family of templates, for example navigation boxes, please make sure that all templates in the same family has the same generic behavior. Template families often share the same documentation, so updating the documentation would be less of a task.

Metatemplates are templates which are intended to be used in other templates and sometimes templates are completely built out of metatemplates. Always discuss your change on the template's talk page before you make changes to such templates.

Documenting templates[edit source]

Template documentation should always be up-to-date and should be updated when templates are modified. Not updating or creating the documentation may result in a block.

Documentation format[edit source]

Template documentation should generally include the following information in the order specified below:

  • The purpose of the template.
  • The parameters of the template.
  • Usage examples of the template.
  • Related templates.
  • Categories.

Documentation boilerplate[edit source]

All documentation should start with {{Doc/Start}} and should end with {{Doc/End}}.

Template purpose[edit source]

The lead section of the template documentation should be a brief introduction purpose of the template, an accompanying "Usage" section to explain in detail of the purpose of the template, this section could also include how template works to assist editors that wish to edit the template, if should it goes too deep into detail of how it works, a sub-section should be used.

Template parameters[edit source]

The second section of the template should be an unorded list of parameters and their default value, properties and description in the following format:

* '''<Parameter name>''': ''(Optional or Default:<value>)'' <Description>

which produces:

  • <Parameter name>: (Optional or Default:<value>) <Description>

Please omit the optional and default section if the parameter is required, only one of "Optional" and "Default:<value>" should exist, since if a default value is set, the parameter is optional.

Template examples[edit source]

The following section should be examples of some general and common usage of the template, this section can be omitted if examples cannot be displayed. The examples could be in the following formats depending on the size or properties:

Format 1[edit source]

Code[edit source]
produces:<br />
<Template call>
Result[edit source]



<Template call>

Format 2[edit source]

Code[edit source]
{| class="wikitable"
! Code !! Result
| <Code> || <Result>
Result[edit source]
Code Result
<Code> <Result>
Notes[edit source]
  • Additional formatting, rows, and columns can be added if desired.

Related templates[edit source]

The last part of the documentation should include a list of related templates and a brief description of them. This part should be split into two sections, sub-templates or child-templates in a section named "Sub-templates", templates with similar purpose in a section named "See also". A navbox could also be added in the "See also" section but should never replace the see also links. Closely related templates could share the same documentation of other templates by using:

{{Documentation|<Template name>}}

Template categories[edit source]

Include categories in the template documentation with {{TC}}, add the code: {{TC|<Category name>}} to the bottom of the documentation before the {{Doc/End}}.

Promotional Content