Help:Templates
A template is a Wikidata page created to be included in other pages. Templates usually contain repetitive material that might need to show up on a larger number of articles or pages.
The most common method of inclusion is called transclusion, where the wikitext of the target page contains a reference to the template, using the {{Template name}} syntax.
This page provide a comprehensive guide to explore and discover templates in Wikidata.
Link templates
editSome templates provides an easy way to link to some kind of things in Wikidata.
Concept | Template | Example |
---|---|---|
Items | {{Q}} |
{{Q|5}} → human (Q5)
|
Properties | {{P}} |
{{P|31}} → instance of (P31)
|
Lexemes | {{L}} |
{{L|1}} → ama/𒂼 (L1)
|
Statements | {{Statement}} |
{{Statement|Q42|P31|Q5}} → Douglas Adams (Q42)instance of (P31)human (Q5)
|
WikiProject | {{Project}} |
{{Project|Templates}} → WikiProject Templates
|
Data types | {{Datatype}} |
{{Datatype|geo-shape}} → Geographic shape
|
Sidenote: MediaWiki templates on this wiki can be linked with {{Template}}
.
Notification templates
editSome templates are useful to create notifications. For instance, {{Ping}}
provides notifications for users and {{Ping project}}
notify participants to a WikiProject.
Voting templates
editVoting templates are useful to vote in a discussion. One can use {{Support}}
or {{Oppose}}
.
Documentation templates
editDocumentation templates are used for documentation. {{Property documentation}}
provides documentation for properties and {{Item documentation}}
provides documentation for items.
There are also class specific templates such as {{TP given name}}
, {{TP family name}}
, {{TP administrative area}}
,{{TP award}}
,{{TP organization}}
.
SPARQL templates
editSPARQL templates provides a way to insert SPARQL queries in Wikidata.
{{SPARQL}}
, {{SPARQL2}}
, {{SPARQL Inline}}
and {{SPARQL Box}}
provide different layout solutions.
{{Query page}}
provides a template to write a query in a dedicated subpage.
For simple queries that only consist of some (subject, predicate, object) triple, you can use {{Quickquery}}
.
Layout templates
edit{{Colorbar}}
provide a graphical element which can be displayed in a page.
Graphic templates
edit{{Graph:Lines}}
shows a line graph.
Internationalisation templates
edit{{LangSwitch}}
provides a solution to multilingual text in a page.
Templates for user pages
edit{{User info}}
See also
edit- See Category:Templates to discover all 261 templates.