Help:Templates

From MEpedia, a crowd-sourced encyclopedia of ME and CFS science and history
Jump to: navigation, search

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.

Two files shown, a Template:Stub (on the left) contains a cloud image and a short message. The fatty acids page (on the right) includes the stub, so it also shows the cloud image and the short message.
A template called stub has been included within another page.

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

{{ }} double brace (curly brackets) in dark blue
Double braces are used for templates

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, {{stub}} 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 templates

Most commonly used by editors

The following table lists the most important templates you may need to use.

Template name Description / Function Advanced (source) editor code Current status Visual editor (TemplateData) status
Citation needed Indicates facts that require citations. {{Citation needed|reason= |date= }} Installed. Working
Stub Indicates a very short article that is a "stub" waiting to be expanded. {{Stub}} Installed. Working
Cleanup Indicates articles that need cleanup and the reason why. {{Cleanup|reason= |date= }} Installed. Working
Reference pages (or Rp) Specify specific page number(s) after a citation. {{Reference pages|page= }} or {{Rp|page= }} Installed. Working.
Reference list (or Reflist) Produces a list of references at the end of an article. Identical to <references/>, but with additional style formatting. {{Reference list}} or {{Reflist}} Installed. Working.

Less commonly used by editors

The following table lists template tags advanced editors may need to use.

Template name Description / Function Advanced (source) editor code Current status Visual editor (TemplateData) status
Message box (or Mbox) Displays a user-friendly information box with a custom message. {{Message box|text= }} or {{Mbox|text= }} Installed. Working.
Glossary entry Adds a glossary entry to the Glossary, in a format to support pop-up definitions on pages. Should be immediately followed by a citation. {{Glossary entry|name=Biopsychosocial model|abbreviation=BPS|definition=a school of thought, usually based in psychology, which claims illness and disease to be the result of the intermingling of biological, psychological and social causes.|synonym1=biopsychosocial model|synonym2=BPS|synonym3=Biopsychosocial|synonym4=biopsychosocial}} Template created for MEpedia. Working.
Glossary see other entry Adds a glossary entry that refers to another glossary entry. {{Glossary see other entry|name=BPS|othername=Biopsychosocial model}} Template created for MEpedia. Working.
Bookmark (or Shortcut) Displays a small reminder box at the target location of a redirect, when the redirect points to a specific location within a page. {{Bookmark|redirect_page}} or {{Shortcut|redirect_page}} Installed. Working.
NeedsImage Mark an article as needing a photo or image adding to it. Adds it to the category Category:Articles that need an image or photo. {{NeedsImage}} Installed. Working.
Disambiguation Mark a page as being a disambiguation page, linking to two or more articles that a word or term may refer to. {{Disambiguation}} Installed. Working.
Done Displays a check-mark with the word "Done" in bold font. {{Done}} Installed. Working.
Collapse top / Collapse bottom Hides a section of a page temporarily. Users can click "expand" or "show" to reveal the hidden section. {{Collapse top|title= }} ... {{Collapse bottom}} Installed. Working.
Main article (or Main) Links a section of one page to the full article concerning that section. {{Main article|page_name= }} or {{Main|page_name= }} Installed. Working.
See also Links a section of one page to a article relevant to that section. {{See also|page_name|display_text_for_page}} Installed. Working.

Important templates used behind the scenes

Users generally don't need to know about these templates, although they are used indirectly.

Template name Description / Function Advanced (source) editor code Current status Visual editor (TemplateData) status
Citation Creates a CS2-style citation, with inline superscript and corresponding footnote. {{Citation|...}} (see template for full syntax) Installed, but needs regular updating to keep up with Citoid changes. Fully integrated into Visual Editor, with both automatic entry and manual entry with TemplateData.
Cite (Cite web, Cite news, Cite book, Cite journal, Cite tweet) Creates a CS1-style citation, with inline superscript and corresponding footnote. {{Cite ...}} (see templates for full syntax) Installed, but needs regular updating to keep up with Citoid changes. Fully integrated into Visual Editor, with both automatic entry and manual entry with TemplateData.
PagesInCategory Automatically displays all of the articles within the specified category {{PagesInCategory|category-name}} This template tag was custom-written for MEpedia, and depends upon the DynamicPageList/Intersection extension. No TemplateData needed.
CategoriesInCategory Automatically displays all of the sub-categories within the specified category {{CategoriesInCategory|category-name}} This template tag was custom-written for MEpedia, and depends upon the DynamicPageList/Intersection extension. No TemplateData needed.
AllPagesHeaderTemplate Allows a banner to be placed at the top of content pages. Automatically added to the top of pages by the PageNotice extension, via interface messages named "MediaWiki:Top-notice-ns-*". N/A Template created for MEpedia. Interface messages defined for each namespace. N/A
AllPagesFooterTemplate Specifies a medical disclaimer. Automatically added to the end of all pages by the PageNotice extension, via interface messages named "MediaWiki:Bottom-notice-ns-*". N/A Template created for MEpedia. Interface messages defined for each namespace. N/A
Welcome Specifies an introductory message for new users. Displayed after new account creation and linked to from the welcome notice. ("notices" at the top of the screen) N/A Template created for MEpedia. N/A
License templates A set of templates to be added to files when they are uploaded by Special:Upload, as specified in MediaWiki:Licenses. Each type of copyright license has its own template. N/A Templates created. May need to be reviewed/updated. N/A

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.

See also

Learn more

Biopsychosocial model (BPS) - A school of thought, usually based in psychology, which claims illness and disease to be the result of the intermingling of biological, psychological and social causes. (Learn more: en.wikipedia.org)

Biopsychosocial model (BPS) - A school of thought, usually based in psychology, which claims illness and disease to be the result of the intermingling of biological, psychological and social causes. (Learn more: en.wikipedia.org)

Biopsychosocial model (BPS) - A school of thought, usually based in psychology, which claims illness and disease to be the result of the intermingling of biological, psychological and social causes. (Learn more: en.wikipedia.org)

Biopsychosocial model (BPS) - A school of thought, usually based in psychology, which claims illness and disease to be the result of the intermingling of biological, psychological and social causes. (Learn more: en.wikipedia.org)

Biopsychosocial model (BPS) - A school of thought, usually based in psychology, which claims illness and disease to be the result of the intermingling of biological, psychological and social causes. (Learn more: en.wikipedia.org)

The information provided at this site is not intended to diagnose or treat any illness.
From MEpedia, a crowd-sourced encyclopedia of ME and CFS science and history.