Miskito/Templates

Template basics
Some elementary instructions for using the course's templates are provided for authors/contributors here. For further information about templates in Wikibooks, see the general Help pages.

Templates without parameters
Some templates require that certain parameters be specified. Before discussing these, let us look at the simplest templates to use: those which have no parameters.

Such a template is placed on the page simply by enclosing the name of the template in double curly braces:

All the templates specially developed for this course have names beginning with Miskito/, so once we know that we can talk informally about those templates here by only mentioning the part after Miskito/. For example, when we say "Later" we are actually referring to the template whose name is Miskito/Later. Therefore we can say that the way to call up a Miskito course template is by writing the following:

Let's try one. If we place this on a page:

then this is what we shall get:

Notice that this is the template listed below (in the template index) as "Later".

One-parameter templates
However, most of the course's templates have at least one parameter. A parameter is like a field, a place where we specify "something" when calling up a template, and that "something" is then incorporated into the way the template shows. We'll start with templates that just have one such parameter. The syntax is then as follows:

Thus the parameter is placed after the name, with a pipe symbol (|) in between. An example of a template taking one parameter is "Review_head". This template places a title bar at the beginning of a review exercise. The parameter represents the instructions to appear at the top of the exercise; whatever we write in the parameter position will appear as the instruction. So for example we can write:

to produce:

or

to produce:

In this case the way the template is formatted can be improved to make it more legible and easier to edit, by inserting a line break after the separator for convenience, and another one before the closing curly braces, as follows (this will make no difference to the final appearance on the page):

We can leave a parameter blank (i.e. specify "nothing" for a parameter) by putting either a blank space or a line break in the position corresponding to that parameter. So if we don't want to include any instructions in this template we may write either:

or:

These both produce:

Parameters can have many different functions; these are specific to each template, as we shall now see.

Templates with two parameters
When a template has two parameters, these are also separated by a pipe symbol:

So for example:

specifies the "related" template, with "Contents" as first parameter and "Table of contents" as second parameter. Which gives this result:

Observe that this element says "Table of contents" (the second parameter) but has a link to the "Contents" page (actually "Miskito/Contents", but referred to as "Contents" for short) - the first parameter. Here are two more examples of templates with two parameters:

gives this result:

and

produces:

Templates with more than two parameters
Other templates work in the same way, but there are more parameters, each with a defined function. Let us take one example: the "lesson" template which is used to insert a new lesson in the table of contents in the following format:

This template has four parameters:


 * 1) lesson number
 * 2) lesson name
 * 3) translation of name
 * 4) list of sections

The example shown is written as follows:

Template limitations

 * 1) Apparently templates will not work properly if a parameter contains an equals sign. --A R King 08:38, 4 February 2007 (UTC)