Help:Embeddable templates
From CruisersWiki
(→Some of the templates used in this wiki) |
m (→POI inline: more "inline" invocation) |
||
Line 93: | Line 93: | ||
<pre><nowiki> | <pre><nowiki> | ||
* A few small shops in the town. | * A few small shops in the town. | ||
- | * {{poi inline | + | * "ISA" is the nearest minimarket from the harbour. {{poi inline |
|type=shopping | |type=shopping | ||
|name="ISA" grocery store | |name="ISA" grocery store | ||
- | |pretext= | + | |pretext=It is located ( |
|coord={{coord|41|14.356|N|9|11.446|E|}} | |coord={{coord|41|14.356|N|9|11.446|E|}} | ||
- | |text=) at the first crossing on the Via del Porto (with Via Angioy and Via Petrini) | + | |text=) at the first crossing from the harbour on the Via del Porto}} (with Via Angioy and Via Petrini) |
* | * | ||
</nowiki></pre> | </nowiki></pre> | ||
Line 104: | Line 104: | ||
Expands to: | Expands to: | ||
* A few small shops in the town. | * A few small shops in the town. | ||
- | * {{poi inline | + | * "ISA" is the nearest minimarket from the harbour. {{poi inline |
|type=shopping | |type=shopping | ||
|name="ISA" grocery store | |name="ISA" grocery store | ||
- | |pretext= | + | |pretext=It is located ( |
|coord={{coord|41|14.356|N|9|11.446|E|}} | |coord={{coord|41|14.356|N|9|11.446|E|}} | ||
- | |text=) at the first crossing on the Via del Porto (with Via Angioy and Via Petrini) | + | |text=) at the first crossing from the harbour on the Via del Porto}} (with Via Angioy and Via Petrini) |
* | * |
Revision as of 11:33, 21 February 2015
This is a draft. Don't use it in production!
|
An introduction into embeddable templates
There are 2 kind of templates in this wiki and one should not be mistaken for another:
- An article template (or Page template) is essentially an article's stub or a boilerplate. To create a new article a user simply copies it's wiki text and pastes it into a new empty article page.
- An embeddable template (or a MediaWiki template) on the other hand generally used to bring a smaller sniplet of mediawiki markup into an article page. They could be seen as a sort of shortcuts introduced into a wiki to implement some common pattern to avoid excessive typing and errors and to implement some common style.
In this sense an embeddable template can be seen as a stencil for some article's feature while an article template is more like a foundation for a whole article.
Similar to an article template a source text for an embeddable template is stored in a wiki page prefixed with "Template:". The difference with a normal wiki page (or an article template) and MediaWiki template is that the later kind of a template is designed to be embedded (or https://www.mediawiki.org/wiki/Transclusion transcluded]) into another page.
Using templates
In the text below embeddable templates will be called simply templates.
Suppose you have a Template:Hello
Hello world!
Then this text can be embedded into another page with this construct:
{{hello}}
An expanded text of a template could be modified with template parameters. Imagine some other template could be called:
{{morning|Earth}}
And give:
Good morning Earth!
Or even like this:
{{go | destination=the Universe}}
Could give:
Our destination is the Universe
Some of the templates used in this wiki
Coord
This template is used to represent coordinates of some geographic location like this:
{{Coord|DD|M.M|N/S|DD|M.M|E/W|}}
It is used either as a standalone, like described in Pagetemplates#CO-ORDINATES TEMPLATE, or in combination with #POI or #Infobox templates (see below).
The 1st 3 parameters of a template are: round number degrees of latitude, minutes of latitude, N or S for hemisphere. The last 3 parameters are the similar ones to the 3 1st, but they denote the longitude part of a coordinate.
Example:{{Coord|37|43.6|N|26|50.6|W|}}
will show as: 37°43.6′N, 26°50.6′W.
POI
POI stands for point of interest. In a wiki article it denotes some geographic location like a city, port or an anchorage. Such a POI must have a name, also it should have some geographic coordinates and a description text.
Example:
{{poi |type=anchorage |name=Cala Spinosa |coord={{Coord|41|14.633|N|9|08.904|E}} |text=A narrow bay W of Baia di Santa Reparata, good holding on sandy patches. }}
This expands to:
Cala Spinosa
To include it into a page copy & paste:
{{poi |type= |name= |coord={{Coord|||N|||E}} |text= }}
A value of a type
parameter should be one of: port, berth, anchorage, shopping, other ( anything else?).
POI inline
This template is quite similar to POI template, except it doesn't breaks a paragraph and does not create headings, so it could be used "inline" a text.
To include it into a page copy & paste:
{{poi inline |type= |name= |pretext= |coord={{Coord|||N|||E}} |text= }}
Example:
* A few small shops in the town. * "ISA" is the nearest minimarket from the harbour. {{poi inline |type=shopping |name="ISA" grocery store |pretext=It is located ( |coord={{coord|41|14.356|N|9|11.446|E|}} |text=) at the first crossing from the harbour on the Via del Porto}} (with Via Angioy and Via Petrini) *
Expands to:
- A few small shops in the town.
- "ISA" is the nearest minimarket from the harbour. Template:Poi inline (with Via Angioy and Via Petrini)