How To Use MediaWiki Templates

From Agony Unleashed
Revision as of 17:46, 13 December 2007 by Risako (Talk | contribs)

Jump to: navigation, search


Basic Info

What is a template you say? A MediaWiki template is a special page in MediaWiki, that you create, that can help with the initial creation of page in a wiki site.

For example, Agony Empire offers many certifications for people to take. Each one of these certifications requires a wiki page where a potential receiver of the certification can find out about the certification such as fees, required certifications and an idea about what the certification will entail. To help make the process easier for making a certification page, there is a template page setup here.

A template page must be made in the Template namespace, such as Template:MyTemplate. You can create this page by typing into your web browser http:///www.agony-unleashed.com/wiki/index.php?title=Template:MyTemplate and hitting the Go button, you will be taken to a page called "Template:MyTemplate". A simple template page acts like a normal wiki page where you edit the page and put what text you want on that page.

On the certification template page, there is only basic boilerplate text for a certification. This text is meant to be replaced once it is inserted into a new certification page with specific information about that particular certification.

Usage

Now that we have a template we can use, we want to insert that boilerplate text into a new certification page we are creating. Create the new certification page and go to edit that page. To insert that template text, all you must do is type
{{subst:Certification}}

This causes the text from the template page to be copied into the new page permanently where from there, you can edit the page to conform it to your needs.

Once you type that subst code into the page, go ahead and save the page to make that copy happen and go right back to editing it. The template text is now there and ready for you to edit.