Tiandi:Templates Tutorial

What are templates?
A  is a shortcut, which is meant to functions (i.e. introduce them to the target page, in which case it is a main template), or to help subsequent templates invoke functions (for the purposes of the guide called a sub-template). The infobox for nations is an example of a template. It helps invoke an informative box ("infobox"), aligned on the right side of a page, which can then be filled out by the author for their respective nation. An infobox is not the only type of template, however. Templates have multiple uses and are essential to the Tiandi Encyclopedia, as they help standardize the authoring practices (by responding only to the preset ) and make authoring more inclusive by eliminating difficult coding on the author's end. A template's (as better seen from its ) gives advice to the author on how to fill out these parameters (such as, when they ask for text, a, or a link to a file). This is important as documentation has not been imported for all templates in the Tiandi Enyclopedia, nor will a template respond on its own to the wrong parameters.

How should templates be imported?
Most of the time, a template is imported into the Tiandi Encyclopedia as it stands from, because the // languages that run it are fully compatible with the former's Miraheze domain. The Tiandi Encyclopedia however lacks the grand majority of templates that constitute Wikipedia, as they do not concern its worldbuilding. In the case that the Encyclopedia's interests expand, templates will likely need to be imported. Templates and modules should be imported from their source and not the documentation itself; otherwise a "template loop" will occur. The documentation's code is merely the code to invoke an already imported template.

Simple templates
A beginning author should hence familiarize themselves with their first and plausibly the easiest of templates to import, the. This will effectively hyperlink a flag (image file) to its country's page (encyclopedia article), and reduce the flag to a when needed. An individual example is the Template:Country data Congress of Nations; for a series of unique Country data templates in effect, see: Tiandi:Who controls what or Leskuswe Bay incidents. In order to successfully import: Now that the template has been imported, it can be invoked in two ways: [nation name] (flag thumbnail plus link to nation page), (only flag thumbnail, useful for manually linking people related to the nation).
 * 1) Upload an image file for your nation's flag.
 * 2) Search for "Template:Country data [insert your nation's name here]".
 * 3) Click on the unavailable hyperlink-prompt (=colored red) to create the page.
 * 4) Paste the following code, as taken from the Wikipedia source:
 * 5) Fill out only the relevant parameters, namely, , and :
 * 6) (Not, but hyperlink, see: File:Jeongmiflag.png)
 * 7) Save changes.
 * 1) Save changes.
 * 1) Save changes.

Complex templates
Complex templates define, for the purposes of this guide, templates which are not standalone (such as the above), but that necessitate either: The documentation of the respective template should already hint to that:
 * 1) Smaller (sub-)templates that are invoked within them; in which case these can be imported before or after the main template's upload.
 * 2) Strings of code ("modules"); in which case these can be imported before or after the main template's upload. (Keep in mind that modules are preceded by "Module:" and not by "Template:" and may have an otherwise identical name to the template they assist.)
 * 3) code importation only accessible to wiki-administrators. (That is due to CSS code manipulation affecting the entire webplace.)

Many templates communicate with Wikipedia's database. Even when complex templates are imported correctly, there are chances of (typically Lua) errors showing up, in which case the original code must be tweaked! Examples include the local Module:Taxonbar/candidate trying to find "wikidata value(s)", in which that function was removed to hide the error warning, and the local Template:Infobox television which attempted to create disambiguation pages for incompliant parameters.