Help:Templates

Our MEpedia software includes both regular pages, and template pages, which are designed to be embedded inside regular pages. Embedding another page is called transclusion. Template pages are very different from templates in the usual sense of the word.

What do template pages do?
A template page can contain a standard message, calculations, add extra formatting, call special programming code, (e.g. to categorize pages) and perform complex functions that change the way a page works. Template pages can add the same content to multiple pages - some of that content may be hidden and some may be extremely complex.

Template pages vs. Template tags
You will probably never have to edit or create template pages, but you will need to use them indirectly when you are editing pages. You might have already used template pages without realizing it. In the source editor you may have seen double braces  (template tags) enclosing the name of a template page. For example,   adds the stub template to a page. In the visual editor template tags often appear as boxes with writing or images that you have to click on to edit.

What do template tags do?
Template tags can be inserted into a page to signify many different things: that a page is a stub, that a page needs a cleanup, that a statement needs a reference, etc. In addition to acting as notes, template tags can also be used for transclusion.

How to add a template tag to a page
To insert a Template tag in the Visual Editor, see MEpedia's Visual Editor guide.

To insert a Template tag in the Source Editor, see MEpedia's Source Editor guide.

Common template tags
The following table lists the most important template tags you may need to use.

How to integrate a new template page into the Visual Editor
A new template page is often copied from www.mediawiki.org or from similar sites. Often, the new “Template:” page is copied along with other pages, such as a “/doc” subpage that contains documentation for the new template page. For more information on copying new template pages from Wikipedia, see MediaWiki’s manual page on the subject.

If you want the new template page to be accessible from the Visual Editor, you must first define the “TemplateData” for the template page. Often, this TemplateData is found in the “/doc” subpage. If you edit the TemplateData in the main “Template:” page, and see a warning that “There is a related TemplateData block on the /doc page”, it just means that the TemplateData has already been defined in the /doc subpage. Due to a bug in our software version, this TemplateData must be moved to the main “Template:” page instead. (See here) For more information on TemplateData, see MediaWiki’s TemplateData help page.

Learn more

 * How to supply TemplateData for the Visual Editor
 * How to copy templates from Wikipedia