AIKa Wiki:Templates

There are many templates in use in AIKa Wiki.
 * Category:Templates should cover all templates in the wiki, categorized into the various subcategories.
 * Special:Templates has all templates in the wiki, grouped by type.
 * The Template namespace (found from Special:Allpages) always has all templates in the wiki, sorted alphanumerically.

What are templates?
Wiki templates provide a means to insert the same content over and over in different (or the same) pages. This saves editors the hassle of duplicating the same text again and again, and also helps ensure consistency.

Guidelines

 * Templates should not normally be used to store article text, as this makes it more difficult to edit the content. They should also not be used to "collapse" or "hide" content from the reader.
 * Templates used in articles are designed to provide information to assist readers, such as navigation aids, formatting, or warnings that content is sub-standard. Templates that provide information only of service to editors should not appear on article pages.
 * Template function should be clear from the template name, but redirects can be created to assist everyday use of very popular templates.
 * Templates should be clearly documented as to their usage and scope.

Referencing templates
Use Template:T template to show example template code (with a link to the template) without using the template itself. For example, to reference the Stub template, you can type, which will result in Stub.

Template names
Template names can be made of one or more words. The first character (only) is not case-sensitive, so stub and Stub are the same template, but   and   are not. Template names are easiest to remember if they follow standard English spelling, spacing, and capitalization. Avoid having templates whose names differ only in case, spacing, or punctuation.

Sandbox for experiments
If you wish to experiment with templates (and not have your experiments deleted before you are done with them), you may do so in the Template sandbox.

Existing templates often each have their own sandbox and test case pages (especially those that use Documentation). Changes should be thoroughly tested there before being applied to the main template, in order to prevent unintentional damage to many pages.

Readability
For templates that use a large number of parameters, it can be helpful to place each parameter on a separate line and align the equals signs. This help future editors to more easily read the wikicode.

Line breaks
Some templates may accidentally cause extra line breaks in the rendered articles. This is especially true of infobox templates and other template boxes that usually float on the right side of an article, since the additional lines will not be seen on the template page.

As a general guideline, avoid two line breaks together in your template. These may "add up" with other line breaks in the article and be displayed as unwanted white space.

Substitution
Invoking a template using the form

parameters

(that is, inserting subst: immediately after the opening pair of curly brackets) will make a copy of the template text and place it on the page, where it will be viewable in the source. The template is no longer transcluded and future changes to the template will not change the text. As a guideline, this method should be used for any short, temporary messages which are removed quickly.

Use subst: also if you need to edit the message after including it on the page. If you don't need to edit it, and would rather the message is automatically updated along with changes made to the template, don't use subst:.

Documentation
Because templates represent a step up in difficulty for the novice editor, documentation should be provided which describes its usage (optional parameters) and scope (where it should be used). There are two different ways to do this:

One alternative is to use to add a minor description direct into the template, for example:

This is a article. Place this template on any article that requires description. It takes one parameter, an adjective used to describe the article. For example, produces the text, This is a bad article.

Another alternative is to create a formal /doc subpage for the documentation (preferred for templates with multiple parameters, etc.) and add  after the actual template. The first "noinclude" tag should be placed on the same line as the end braces of the actual template in the following manner:

...

If the "noinclude" tag starts on the line below the template's closing braces, then unwanted whitespace is introduced at the bottom of the template when it is used in articles and on other pages.

Where you may find more templates

 * Templates Wiki
 * Wikipedia; may be copied with the proper acknowledgment, but some need tweaking to work properly on Fandom wiki, so use a Templates Wiki one if possible.