Help:Wiki template: Difference between revisions

From COLLADA Public Wiki
Jump to navigation Jump to search
Elf (talk | contribs)
copying text I wrote from http://www.bayteam.org/wiki/Help:Templates
 
Elf (talk | contribs)
editing for this site
Line 1: Line 1:
This wiki software allows us to define '''templates''', which in other languages might be called '''macros''' (or other similar terms).  
This wiki software allows us to define '''templates''', which are the same concept as '''macros''' in some languages.  


==Overview==
==Overview==
Line 6: Line 6:
  This page needs more work to make it look good.
  This page needs more work to make it look good.


Furthermore, templates can have ''arguments'' (parameters) that allow you to specify repetitive data in a standard and more easily understandable way. For example, you could define a template named '''trial-committee''' that provides space for someone to type the names of trial committee members and then displays the list in a nice format as defined within the template, rather than making the editor do all the work over and over.
Furthermore, templates can have ''arguments'' (parameters) that allow you to specify repetitive data in a standard and more easily understandable way. For example, you could define a template named '''plug-in''' that provides space for someone to type the basic information about a COLLADA plug-in and then displays the info in a nice format as defined within the template, rather than making the editor do all the work over and over.


==Template usage==
==Template usage==
Line 12: Line 12:
   <nowiki>{{needswork}}</nowiki>
   <nowiki>{{needswork}}</nowiki>
or like this:
or like this:
   <nowiki>{{trial-committee|chair=Fred Smith|secretary1=Jane Doe|secretary2=Tien Tranh}}</nowiki>
   <nowiki>{{plug-in|name=My Plug In|web=http://www.mycompany.com|version=1.4}}</nowiki>


==Template definition==
==Template definition==
To create a template, you simply create an article titled "Template:nameofyourtemplate"; for example, Template:needswork or Template:trial-committee. Whatever  you put into that article then appears whenever you insert the template (as shown in "Template usage") into another article.
To create a template, just create an article titled "Template:nameofyourtemplate"; for example, Template:needswork or Template:plug-in. Whatever  you put into that article then appears whenever you insert the template (as shown in "Template usage") into another article.


==Complexities==
==Complexities==
Of course, it's almost never ''that'' simple. Here are some example templates, whose content you can examine by clicking their '''edit''' tabs:
There are additional features that are useful in templates, including
*[[Template:Addtocategory]], which displays standard text and also uses a predefined variable to display the name of the current article.
*Predefined variables that do such things as calculate the name of the current article.
*[[Template:Disambig]], which displays standard text and also puts any article in which it appears into a specific category.
*Special markup to have things appear only in the template definition page but not where the template occurs, or vice-versa.
*[[Template:Trial]], which allows parameters, then displays the values into a formatted table AND this template displays usage information about the template itself.
 
These are documented elsewhere; see "External links."


==See also==
==See also==
*[[Special:Prefixindex]] where you can select the '''Template''' namespace and see the names of all templates that currently exist.
*[[Special:Prefixindex]] where you can select the '''Template''' namespace and see the names of all templates that currently exist in this wiki.
*[[BTwiki templates]], which lists existing templates and shows what they produce


==External links==
==External links==
(need links to detailed help on wikipedia, wikimedia, etc.)
*[http://meta.wikimedia.org/wiki/Help:Template Wikimedia Help:Template article]
*[http://en.wikipedia.org/wiki/Wikipedia:Template_namespace Wikipedia Template namespace article]


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

Revision as of 04:20, 14 March 2007

This wiki software allows us to define templates, which are the same concept as macros in some languages.

Overview

A template can define standard text that you'd like to appear in more than one place. For example, you could define a template named needswork that, when inserted into a page, displays text like this:

This page needs more work to make it look good.

Furthermore, templates can have arguments (parameters) that allow you to specify repetitive data in a standard and more easily understandable way. For example, you could define a template named plug-in that provides space for someone to type the basic information about a COLLADA plug-in and then displays the info in a nice format as defined within the template, rather than making the editor do all the work over and over.

Template usage

When editing an article, you see templates like this:

 {{needswork}}

or like this:

  {{plug-in|name=My Plug In|web=http://www.mycompany.com|version=1.4}}

Template definition

To create a template, just create an article titled "Template:nameofyourtemplate"; for example, Template:needswork or Template:plug-in. Whatever you put into that article then appears whenever you insert the template (as shown in "Template usage") into another article.

Complexities

There are additional features that are useful in templates, including

  • Predefined variables that do such things as calculate the name of the current article.
  • Special markup to have things appear only in the template definition page but not where the template occurs, or vice-versa.

These are documented elsewhere; see "External links."

See also

  • Special:Prefixindex where you can select the Template namespace and see the names of all templates that currently exist in this wiki.

External links