About templates
Jump to navigation
Jump to search
What are templates
MediaWiki templates are essentially pre-formatted pieces of text that can be included in other pages1. They are designed to be transcluded (embedded) inside other pages2. Here’s a simple explanation:
- Creation: You create a page in the “Template” namespace. For example, you might create a page called “Template:Welcome” with the contents: "Hello! Welcome to the wiki."2.
- Usage: You can then insert this template into any other page using the code { {Welcome}} (without the spaces). When that page is viewed, the text “Hello! Welcome to the wiki.” will appear instead of { {Welcome}}. This is called "transclusion"2.
- Modification: If you change the content of the template, it will automatically update on all the pages where the template is used. For example, if you change “Template:Welcome” to say “Hi there! Welcome to this wonderful wiki.”, all pages using { {Welcome}} will now display the new message2.