Mediawiki Templates

From emboxit
Jump to: navigation, search

Introduction

  • Includes
  • Parameters
  • Organizing templates: How to self document a Template
  • Copying from one wiki to another
  • Which could be very-time-consuming if tried without reading this!!!
  • Copied from above

The "MediaWiki:" namespace was also originally used for creating custom text blocks that could then be dynamically loaded into other pages using a special syntax. This content was later moved into its own namespace, "Template:".

Templates are text blocks that can be dynamically loaded inside another page whenever that page is requested. The template is a special link in double curly brackets (for example "{{Disputed|date=October 2008}}"), which calls the template (in this case located at Template:Disputed) to load in place of the template. Templates support parameters, so that parts of the text can be substituted for each specific use case. A related method, called template substitution (called by adding subst: at the beginning of a template link) inserts (like a copy and paste operation) the contents of the template into the target page, instead of loading the template contents dynamically whenever the page is loaded. This can lead to inconsistency when using templates, but may be useful in certain cases, and in most cases requires fewer server resources (the actual amount of savings can vary depending on wiki configuration and the complexity of the template).

Templates have found many different uses. Templates enable users to create complex table layouts that are used consistently across multiple pages, and where only the content of the tables gets inserted using template parameters. Templates are often used to identify problems with a Wikipedia article by putting a template in the article. This template then outputs a graphical box stating that the article content is disputed or in need of some other attention, and also categorize it so that articles of this nature can be located. Templates are also used on user pages to send users standard messages welcoming them to the site, giving them awards for outstanding contributions, and so on.

Details


Simplest Example


 [[Template:Welcome]] 
 {{Welcome}}
 

Template:Welcome
Hello! Welcome to nikos chalikias emboxit wiki.


The first Template created for emboxit

  • Template Cat1 created for adding easily categories to emboxit wiki