Help:Templates: Difference between revisions

From 118Wiki
Jump to navigation Jump to search
(Page created)
 
(Link to Mediawiki: Help:Templates)
Line 21: Line 21:
A template can be created in the same way as a ordinary page, just instead of just typing the pages name you type Template: before it to mark it as a template.
A template can be created in the same way as a ordinary page, just instead of just typing the pages name you type Template: before it to mark it as a template.


==More help on templates==
* [http://www.mediawiki.org/wiki/Help:Templates Mediawiki: Help:Templates]


[[Category:Help]]
[[Category:Help]]

Revision as of 21:49, 3 July 2013

Templates are a way to include commonly reused segments of text or code. They also make pages sources easier to read by removing complicated elements.

Example

For instance adding {{Template:NPC ship}} to a page makes it add this:

Non-Starfleet NPC Vessels
Edit Listing

SS Andraste · Astrolabe . Crystal Star III · Eagle's Eyrie · SS Evangeline · FTS: ( Asterospolis · K'roc · K'tarn · Marauder · P'Kothla · Serapis · Treasure Sprite ) · Furies Furnace Base · Hawkeye · SS Idril Mar · Labyrinth's Scream · SS Lady Adventure · Midway Station · Rihac Gorshun · SS Shining Star · Skiptrace · Southern Cross · SS Tanandra · Te'Lir

StarBase 118 Fleet Active Vessels Inactive Vessels Lost or Decommissioned Vessels
NPC Ships

This is a reasonably large segment of code, that would be inconvenient to add to many pages that require it, so it as added as a template in order to make it easier.

Guidelines

Before we talk about how to make Templates, it is a good idea to consider when we should use templates.

  1. Templates should only be used for code which is likely to be re-used on a number of pages.
  2. Templates are unnecessary for short segments.

For instance using a template to include a universal navigation for a set of pages in a series is a good use, while creating a template for the "Stats" segment on your characters page is unnecessary.

How to create a template

A template can be created in the same way as a ordinary page, just instead of just typing the pages name you type Template: before it to mark it as a template.

More help on templates