Help:Templates

From Eckerd Academic Wiki
Jump to: navigation, search

What is a template?

A template is a wiki page, or a section of a wiki page, that is generated by a snippet of computer code. The code is stored in the Template Namespace, and so can be used over and over again. This makes it very easy to generate the identical template for phrases, blocks, or pieces of a page that you might want to use in many different places. For example, you might want to generate a particular logo on every page of a course project. A template command can do that for you.

A simple template

When you type ~~~~ (four tildes) on a wiki page, you invoke a piece of computer code that results in the date, time, and your log-in name being displayed. The ~~~~ command works over and over, and is a fast way to sign your name. In this case, your signature, the date, and the time are the template generated.

Are templates hard to design and create?

Most templates require too much knowledge of HTML, the Web page design language, for the average user to create one from scratch. The solution, therefore, to using templates is to copy someone else's and then modify it to your specifications. This may seem a bit sketchy (shady) for those trained in academia, but it is really not. Open source software is built on the idea that people will modify someone's code and perhaps make it better. As long as you leave your modification available for others to use, you are a member in good standing of the open source community.

A tutorial

Steve Weppner has borrowed a couple of templates from here. They were modified and sit in the Template Namespace at Template:PH241 Welcome and Template:PH241 Introduction.

Here is the welcome template for his General Physics I class ...

Welcome to PH241 Wiki Page    Dr. Weppner, Eckerd College
MediaWiki Newton

Handouts     Laboratory     Ubiquitous Presenter       Help Editing     Using Math



...and here is the introduction template for his class.

These are cute little wiki templates that will be used in the header for every PH241-001 page. What is convenient is that to insert these templates into a page, you simply hit the edit tab, type {{template name here}} where you want the template to appear, and then save the page. For example, to place the welcome template (above) into one of your pages, you just need to put "{{PH241 Welcome}}" into the text.

Feel free to create a new page and copy these to it (you must cut and paste the source from these templates into your page. To work, you must first put the template in the correct area by naming it something like "Template: My New Template" or "Template:New Course Header", where the page name must begin with a "Template:" prefix.



Now the above two templates can be joined to make a single page-wide banner called Template:PH241 Heading, and here it is:

Welcome to PH241 Wiki Page    Dr. Weppner, Eckerd College
MediaWiki Newton

Handouts     Laboratory     Ubiquitous Presenter       Help Editing     Using Math

Info
Info

{{{1}}}

This was created simply by inserting the expression {{PH241 Heading}} in the text for this wiki page. Feel free to copy and modify these ideas.

If you would like to use other templates available on the Web, search for wiki designs that you like. Once you find one, choose "edit". At the very bottom of the page you will see the templates (and links to them) used in that page, thus making it easy to copy them. Try it out: edit this page and at the bottom you will see links to the templates used for it.

The templates used in this Eckerd Wiki can be found here.

If you create a template it might be a good idea to protect it with the appropriate tab at the top of the page.