Templates: Difference between revisions

Jump to navigation Jump to search
m (Gerald Chi moved page Help:Templates to Templates without leaving a redirect)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
{{CMG}}


==What is a template?==
A template is a computer program that generates the same content on multiple pages.  For example, the help menu that appears at the bottom of the page is a template that appears on all pages. If you edited a page, at the bottom of that page, you would see the code <nowiki>{{WH}}</nowiki>. This tells the software to insert the help menu at the bottom of the page.


==Give an example of a template==
==Give an example of how and why I might want to create a template==
Say you don't want to type the following sentence everytime you add your name to a page as Editor-in-Chief:
Using a template can save you time so that you don't have to type the same text over and over again. Say you don't want to type the following text every time you add your name to a page as Editor-in-Chief:


  Editor-In-Chief: William Smith, M.D.; Greater City Hospital, Middletown USA
  '''Editor-In-Chief:''' Bill Smith, M.D.; Greater City Hospital, Anytown USA


Instead of typing this everytime, you could create a template with a short name like WS. When you type in <nowiki>{{WS}}</nowiki> then  
Instead of typing this text every time, you could create a template with a short name like BS. When you type in <nowiki>{{BS}}</nowiki> then  


Editor-In-Chief: William Smith, M.D.; Greater City Hospital, Middletown USA
'''Editor-In-Chief:''' Bill Smith, M.D.; Greater City Hospital, Anytown USA


would appear.
would appear.


==How do I create a template to put my name in on multiple pages?==
==How do I create a template to put my name in on multiple pages?==
Create a page named after the abbreviation you want to use. The word <nowiki>Template:</nowiki> must proceed the name of the page. For William Smith, this would be:
Create a page named after the abbreviation you want to use. The word <nowiki>Template:</nowiki> must proceed the name of the page. For Bill Smith, this might be:


<nowiki>Template:WS</nowiki>
<nowiki>Template:BS</nowiki>


On this new page called <nowiki>Template:WS</nowiki> type in the text you want to appear:
On this new page called <nowiki>Template:BS</nowiki> type in the text you want to appear:


  Editor-In-Chief: William Smith, M.D.; Greater City Hospital, Middletown USA
  '''Editor-In-Chief:''' Bill Smith, M.D.; Greater City Hospital, Anytown USA


Save the page.
Save the page.


When you
When you want your name to appear as Editor-In-Chief, insert the template
 
<nowiki>{{BS}}</nowiki>
 
It will then show up like this:
 
{{BS}}
 
 
[[Category:Help]]
 
{{WikiDoc Help Menu}}
{{WikiDoc Sources}}

Latest revision as of 14:05, 2 September 2013

Editor-In-Chief: C. Michael Gibson, M.S., M.D. [1]

What is a template?

A template is a computer program that generates the same content on multiple pages. For example, the help menu that appears at the bottom of the page is a template that appears on all pages. If you edited a page, at the bottom of that page, you would see the code {{WH}}. This tells the software to insert the help menu at the bottom of the page.

Give an example of how and why I might want to create a template

Using a template can save you time so that you don't have to type the same text over and over again. Say you don't want to type the following text every time you add your name to a page as Editor-in-Chief:

Editor-In-Chief: Bill Smith, M.D.; Greater City Hospital, Anytown USA

Instead of typing this text every time, you could create a template with a short name like BS. When you type in {{BS}} then

Editor-In-Chief: Bill Smith, M.D.; Greater City Hospital, Anytown USA

would appear.

How do I create a template to put my name in on multiple pages?

Create a page named after the abbreviation you want to use. The word Template: must proceed the name of the page. For Bill Smith, this might be:

Template:BS

On this new page called Template:BS type in the text you want to appear:

Editor-In-Chief: Bill Smith, M.D.; Greater City Hospital, Anytown USA

Save the page.

When you want your name to appear as Editor-In-Chief, insert the template

{{BS}}

It will then show up like this:

Editor-In-Chief: Bill Smith, M.D.; Greater City Hospital, Anytown USA


Template:WikiDoc Sources