Template page

From OLPC

Jump to: navigation, search

Why and what do you need a "template" or "template page" for?

  1. Imagine you have content that is useful to appear on several pages. E.g. every starting page for a country benefits from showing information on deployments in the country, maybe a link to the wikipedia page to read up on the country, etc. Another example: 2014 has been dedicated to by the United Nations as the "2014 UN International Year for Small Island Developing States". I wanted to make the reference and logo of this year appear on all the starting pages of island states that have olpc deployments. Instead of copy/pasting the same content over and over again, I just made 1 template page with the logo, some references and some text and used the double accolades instruction - which the software that makes this wiki recognises - to pull the content of the template page into the islands' starting page.
  2. It's a time saver. Imagine you add or change some content in the template page: the advantage is that the changes appear immediately on all the pages that invoke the template page. So you don't have to go to all the tens of starting pages of all the islands separately, click the edit button, change the text, hit the save button and eventually checkmark the "This is a minor edit".
  3. It cleans up the code in a page.

Example of a "template page"

  1. http://wiki.laptop.org/go/Template:OLPC_Oceania
  2. and a page where it is invoked to : http://wiki.laptop.org/go/OLPC_Oceania
  3. this is how a template is invoked: {{name of template}}; by putting the template page name between these 2 pairs of accolades.

How to edit or make a "template page"?

  1. hit the edit button of the page and find the relevant template in de code. You'll recognise it because of the two pairs of accolades with the template page name between them, like {{name of template}}
  2. Copy/paste the page name in your wiki's root, like http://wiki.laptop.org/go/Template:OLPC_Oceania
  3. Smart thing to do when you make a template page: always add a link to the template page so people don't have to do the above. Example # Reference to this template, where you can eventually edit it.
Personal tools
  • Log in
  • Login with OpenID
About OLPC
About the laptop
About the tablet
Projects
OLPC wiki
Toolbox