Miskito/Templates
Miskitu Aisas! Miskito Language Course | |||
Layout | Using the templates | ||
> Next | |||
Contents | |||
Template basics
[edit | edit source]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
[edit | edit source]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:
{{TEMPLATE NAME}}
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:
{{Miskito/NAME}}
Let's try one. If we place this on a page:
{{Miskito/Later}}
then this is what we shall get:
THIS CONTENT WILL BE ADDED LATER |
Notice that this is the template listed below (in the template index) as "Later".
One-parameter templates
[edit | edit source]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:
{{Miskito/NAME|PARAMETER}}
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:
{{Miskito/Review_head|Translate:}}
to produce:
or
{{Miskito/Review_head|Pretend that someone asks you the following questions. Pretend that you live in another village and answer the questions.}}
to produce:
Pretend that someone asks you the following questions. Pretend that you live in another village and answer the questions.
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):
{{Miskito/Review_head| Pretend that someone asks you the following questions. Pretend that you live in another village and answer the questions. }}
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:
{{Miskito/Review_head| }}
or:
{{Miskito/Review_head| }}
These both produce:
Parameters can have many different functions; these are specific to each template, as we shall now see.
Templates with two parameters
[edit | edit source]When a template has two parameters, these are also separated by a pipe symbol:
{{Miskito/NAME|FIRST PARAMETER|SECOND PARAMETER}}
So for example:
{{Miskito/Related|Contents|Table of contents}}
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:
{{miskito/Review|My name is John.|Nini John sa.}}
gives this result:
Nini John sa.
and
{{miskito/Generic_table| This is the heading.| This is a list of three numbers: *number one *number two *number three That's the end of the list. }}
produces:
This is the heading. |
This is a list of three numbers:
That's the end of the list. |
Templates with more than two parameters
[edit | edit source]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:
Lesson 1: Nini Mary sa (My name is Mary)
is / this and that / the / a
This template has four parameters:
- lesson number
- lesson name
- translation of name
- list of sections
The example shown is written as follows:
{{miskito/Lesson|1|Nini Mary sa|My name is Mary| ''is'' / ''this'' and ''that'' / ''the'' / ''a'' }}
Template limitations
[edit | edit source]- Apparently templates will not work properly if a parameter contains an equals sign. --A R King 08:38, 4 February 2007 (UTC)
Template index
[edit | edit source]
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
| ||||
|