Help:Template

From OneSci
Jump to: navigation, search
There are three main reasons to use a template
1. The same info/graphics/text can be used by multiple articles without needing to retype
2. Technical or intricate formatting of info/graphics/text can be added without cluttering up the text of an article with code
3. Reduced chance messing-up the technical formatting and makes it easier for noobs to contribute


Basically it works like this

File:Template.png



For example, if you wanted to add this box (below) to a page, you have two options.

A Template Example
An Open-Access, Peer-Reviewed, Example


You could put this code directly onto the current page.

{| id="mp-topbanner" style="width:50%; background:#fcfcfc; margin-top:1.2em; border:1px solid #ccc;"
| style="width:56%; color:#000;" |
{| style="width:280px; border:none; background:none;"
| style="width:280px; text-align:center; white-space:nowrap; color:#000;" |
<div style="font-size:250%; border:none; margin:0; padding:.1em; color:#000;">A Template Example</div>
<div style="top:+0.2em; font-size:95%;">An Open-Access, Peer-Reviewed, Example</div>
|}
| style="width:16%; font-size:95%;" |
* [[Articles]]
* [[Posters]]
* [[Protocols]]
|}


Or you could put the code on a template page. Template pages must all start with -         Template:         - and after the colon you can name it anything you'd like. For instance:

Template:ExampleTemplate


Then, any text on that page can be called to another page, simply by using the name of the template inside double squiggly brackets, like this:

{{ExampleTemplate}}


Thus, the page will assume that all of the text and code on the template page exists where
{{ExampleTemplate}}
is located on the page, without cluttering up the page with code.
Personal tools