PhilanthropyWiki

Help:Templates

From PhilanthropyWiki

Contents

Use of Templates on the PhilanthropyWiki

MediaWiki's Template function is used in several instances on the PhilanthropyWiki:

  • To embed Infoboxes on pages, and maintain efficiency when the Infoboxes undergo structural changes.
  • To apply Labels to pages with standard statements that relate to the type of information contained within the page.
  • To ensure efficient storing and cross-referencing of information - for example the Overview pages in Category:Program Areas embedded on category pages within; and definitions in the Glossary embedded on relevant pages.

All Infoboxes can be found in Category:Infoboxes.

How MediaWiki uses the "Templates" function

Transclusion

Refers to the practice of 'Transclusion', where one page is embedded within another. The benefit of Transclusion is that when the original page is edited, the changes are applied to all locations it is embedded in also. For example, the PhilanthropyWiki:Contact page is embedded on the PhilanthropyWiki:Administrators and PhilanthropyWiki:Feedback pages. The term "Templates" is used when discussing transclusion because of the wiki code used to do the embedding - it is the same code used to embed templates such as infoboxes on pages:

{{PhilanthropyWiki:Contact}}

Infoboxes

The Template wiki code (surrounded by curly brackets, see above) is also used when embedding Infoboxes on pages.

The term 'Template' is applied more logically here, as the curly brackets are used to embed basic templates for information on pages, with unique info then added depending on the page.

See Help:Infoboxes for more information on how these templates are built to allow info to be put in them on each page.



Some rules for the wiki code

  • If you are embedding an ordinary page within the wiki, you will need to prefic the name of the page in the curly brackets with a colon. For example, to embed the Bequest definition page on the Bequests Category page, it will look like this:
{{:Bequest}}


  • If you are embedding an infobox, or another template that is housed in the Templates Namespace, then neither a colon or the prefix of "Template" needs to be included. For example, to embed Template:Label-Archive on a page, it will look like this:
{{Label-Archive}}


  • If you are transcluding a page that is not in the main namespace or the Templates namespace, include its prefix as well. For example, when embedding the PhilanthropyWiki:Contact page:
{{PhilanthropyWiki:Contact}}


  • Be aware that trascluding a page will include all the elements of it within the page you are embedding it in - including the categorising code. Therefore, you need to put noinclude codes around the elements of a page you do not wish to be transcluded. For example, on the Bequest page in the glossary, the noinclude code is used thus:
<noinclude>
==See Also:==

* [[:Category:Bequests|Structures & Models: Bequests]]

[[Category:Glossary]]
</noinclude>


  • There are certain types of pages within MediaWiki that cannot be transcluded. Most of the Special Pages cannot, and neither can the category pages.
PhilanthropyWiki
Member Tools