Small wiki toolkits/Starter kit/Templates and Modules

From Meta, a Wikimedia project coordination wiki
Jump to navigation Jump to search

Templates[edit]

Wikitemplates Logo.svg

Templates are written in Wikitext, HTML, CSS, and Lua. They can be transcluded on several wiki pages and are commonly used for standard warnings or notices, infoboxes, content formatting, and alignment, improving citations, etc. Templates are located in the Template namespace on a wiki.

Visit the page Special:MostTranscludedPages on a wiki to get a list of the most used templates. For example, Special:MostTranscludedPages lists the most transcluded pages on French Wikibooks.

Popular templates on wikis[edit]

Templates in this category meet the criteria listed below:

  • Widely used across wikis.
  • Widely tested, proven useful and reliable.
  • Well-documented and maintained.
  • Implement an important feature of Wikimedia sites.

Note: The table below was last updated on 2020-05-12 and is based on this list manually curated in 2017.

Category Template Template description Transclusion count on English Wikipedia
Standard warnings or notices Ambox Ambox stands for Article Message box and helps build message boxes for templates used in articles. Note: This template uses a Lua module. 1,297,035
Stub Helps identify a Wikipedia:Stub. -
Underconstruction Used for articles undergoing construction. -
Warning To be used only for essential warnings related to an article or a user. 59,115
Infoboxes Infobox An infobox is a fixed-format table usually found on the top right-hand corner of wiki articles and it presents a summary of information about the subject of an article. Template:Infobox is a meta-template used to organize an actual infobox template on a specific topic (e.g., Template:Infobox person). Additional notes:
  • This template uses a Lua module.
  • Importing infoboxes would require familiarity with certain MediaWiki features, import/export rights on source/destination wikis, and a set of extensions installed. See Manual:Importing Wikipedia infoboxes tutorial for importing infoboxes used by English Wikipedia. If you are new to the process, it would be ideal to seek help from experienced contributors in or outside of your local wiki.
3,206,447
Infobox person Belongs to Category:People and person infobox templates, help organize meta-level information about a particular person. Note: This template uses Lua modules. 318,685
Infobox settlement This template is used as a sub-template for several infobox front-end templates to produce an infobox for human settlements, for example, cities, towns, villages, communities, districts, counties, etc. Note: This template uses Lua modules. 488,862
Infobox building This template is used to summarize information about a building or built structure, including skyscrapers, hotels, hostels, performance venues, and shopping centers. Note: This template uses Lua modules. 19,120
Taxobox Help set out the biological classification (taxonomy) for a group of living things. Additional notes:
  • This template uses a Lua module.
  • Taxobox on Catalan Wikipedia is easier to use than the English Wikipedia version of the template as it is Wikidata powered and doesn't require manual parameters.
230,662
Wikidata-powered Infoboxes Creating or improving Wikipedia infoboxes is easier and faster using the data from Wikidata and, in turn, benefits Wikidata. A few solutions for using Wikidata-powered infoboxes are listed below:
  • Template: DataBox: It is a Lua-based module and a fully automated solution for creating an infobox using Wikidata content, specially designed for small Wikipedias. It doesn’t require any configuration changes and knowledge of Lua for using it unless you want to customize it to meet your local wiki needs.
  • Wikidata-powered infoboxes on Catalan Wikipedia: They are multilingual and easier to use on other Wikipedias. See more information in this presentation.
  • Template: Wikidata infobox: It is mostly used on Wikimedia Commons and slightly less on English Wikipedia in the Category pages. It uses wikitext to pull data from Wikidata. As it depends on many other modules, it is challenging to port this template to another wiki.

See Wikidata:Infobox Tutorial for a tutorial on how to create Wikidata-powered infoboxes.

-
Citations Cite web Helps create citations for web sources. Note: This template uses a Lua module. 3,027,367
Cite journal Helps create citations for academic and scientific papers and journals. Note: This template uses a Lua module. 566,664
Cite book Helps create citations for books. Note: This template uses a Lua module. 1,046,873
Cite encyclopedia Helps create citations for articles in encyclopedias. Note: This template uses a Lua module. 100,793
Citation needed Helps identify uncited claims in articles. 380,303
Reflist Formats and organizes a list of references. 4,667,990
Unreferenced To be used on articles with no citations or references. 224,511
More citation needed To be used on articles with insufficient citations. 222,670
Alignment & formatting Center Positions elements in the center of the page. 516,521
Plainlist Creates an unbulleted list. 159,336
Font color Applies text and background color. 90,312
Utility Birth date and age Return's a living person's birth date and age. Note: This template uses a Lua module. 546,196
Clear Adds <div style="clear:both;"></div> and is used to prevent text from flowing next to unrelated images. 2,134,481
Done + Done/See_also Belongs to Category:Resolution templates, these templates are used inline and help mark the status of a talk page discussion, vote, or other processes. 72,394
Ping Used in replying to a user(s) as it creates a wikilink to their page that notifies them. 111,520
Coord Gives a standard representation for encoding locations by their latitude and longitude coordinates. 1,152,903
Lang Help indicate a text in a specific language. There are several templates in Category:Lang-x templates available for different languages. 221,029
Documentation Used on a template page for documenting related instructions. 70,377

Guidelines for templates[edit]

Modules[edit]

Lua-Logo.svg

A Module is written in Lua. Lua is a scripting language that is supported on all Wikimedia wikis via the Scribunto extension. Lua modules can be used to simplify complex templates that cause performance issues and for handling string, mathematical and logical operations. Modules can be used stand-alone but they are mostly used in conjunction with the templates. Modules are located in the Module namespace on a wiki.

If a template is using modules, you will see the Template:Lua embedded on its documentation page. For a template to work, the modules it uses should be copied to another wiki as well, in addition to the template itself. Writing Lua modules is recommended for experienced MediaWiki template developers. See Lua/Tutorial and learn to adapt a template to a Lua module.

Visit the page Special:MostTranscludedPages on a wiki to get a list of the most used templates on that wiki. For example, see Special:MostTranscludedPages for most transcluded pages on Hindi Wikisource.