Mall:Navmall

Allikas: Vikipeedia
[redigeeri] Template-info.svg Malli dokumentatsioon


Information icon.svg See mall sisaldab keerulisi süntaksielemente.
Enne selle malli redigeerimist tuleks end kurssi viia selle ülesehituse ja parserifunktsioonidega. Kui redigeerimisel tekib ettenägematuid probleeme, pöördu palun kiiresti tagasi viimastele muudatustele, sest seda malli kasutavad paljud lehed.
Palun katseta muudatuste tegemist kas malli liivakastis või oma kasutajalehe alamlehel enne, kui teed muudatusi siin.

HOIATUS! Pärast malli koodi vahetust võib kogemata kombel kuskil mingeid ootamatusi ilmneda. Anomaaliate esinemisel palun sellest malli arutelulehel koheselt teada anda. Ahsoous.

Malli tuleb tõlkida ja kohandada!

Kood

Kopeeri see malli ja eemalda tühjad väljad. Väljale nimi jäta {{subst:PAGENAME}}, see teeb automaatselt malli nime.

{{Navmall
|nimi     = {{subst:PAGENAME}}
|olek     = 
|päis     = 
|pilt     =
|piltvasakul = 
|ülemine  = 
|grupp1   = 
|loend1   = 
|grupp2   = 
|loend2   = 
 ...
|grupp20  = 
|loend20  = 
|alumine  = 
}}<noinclude>
[[Kategooria:Navigeerimismallid|{{PAGENAME}}]]
</noinclude>

Parameetrite loend

Navigeerimismall kasutab väiketähelisi parameetrite nimesid, as shown in the box (at right). Nõutavad parameetrid nimi ja päis loovad üherealise kast kui teised parameetrid jätta ära.

Pildid ja grupid omavad piiranguid mida on seletatud jaotuses Parameter descriptions, kus teine parameeter ("piltvasakul" ) võib välja vahetada kõik gruppide lahtrid.

Pane tähele, et "grupp1" (jne.) on valikulised, nii nagu ka sektsioonid "ülemine/alumine".

Parameetrite lühikirjeldus:

nimi - malli nimi.
päis - tekst päises, nagu näiteks: [[Widget stuff]].
olek - autocollapse, show, collapsed, või plain (navigeerimiskasti laiendamise staatus,
kus "autocollapse" peidab kuhjatud navigeerimiskastid; "plain" eemaldab "[peida]" nupu).
päisestiil - CSS stiil päise jaoks, nagu näiteks: background:gray;
grupistiil - CSS stiil grupilahtrite jaoks nagu näiteks: background:lightgray;
pilt - an optional right-side image (coded as the whole image tag: [[Image:XX.jpg|90px]] ).
piltvasakul - an optional left-side image, replacing group-cells (coded as the whole image tag).
ülemine - text to appear above the group/list section (could be a list of overall wikilinks).
gruppn - the left-side text before list-n (if group-n omitted, list-n starts at left of box).
loendn - text listing wikilinks, often separated by middot templates, such as: [[A]]{{·}} [[B]]
alumine - optional text to appear below the grupp/loend section.
navbar - title-bar nav link (default: Tnavbar for v • d • e links; "navbar=plain" will omit).

Further details, and complex restrictions, are explained below under section Parameter descriptions. See some alternate navbox formats under: Layout of table.

Parameetrid

Kohustuslik

nimi
The name of the template, which is needed for the "v · a · r" ("vaata · arutelu · redigeeri") links to work properly on all pages where the template is used. You can enter {{subst:PAGENAME}} for this value as a shortcut.
päis
Text that appears centered in the top row of the table. It is usually the template's topic, i.e. a succinct description of the body contents. This should be a single line, but if a second line is needed, use {{-}} to ensure proper centering.
loendn (body may be used in place of loend1)
(näiteks loend1, loend2 jne) The body of the template, usually a list of links. Format is inline, although the text can be entered on separate lines if the entire list is enclosed within <div> </div>. At least one loend parameter is required; each additional loend is displayed in a separate row of the table. Each loendn may be preceded by a corresponding gruppn parameter, if provided (see below).

Vabal valikul

Lahtrid

gruppn
(näiteks grupp1, grupp2, etc.) If specified, text appears in a header cell displayed to the left of loendn. If omitted, loendn uses the full width of the table.
pilt
An image to be displayed in a cell below the title and to the right of the body (grupid/loendid). For the image to display properly, the loend1 parameter must be specified. The pilt parameter accepts standard wikicode for displaying an image, i.e.
[[Image:Example.jpg|100px]]
piltvasakul
An image to be displayed in a cell below the title and to the left of the body (lists). For the image to display properly, the list1 parameter must be specified and no groups can be specified. The piltvasakul parameter accepts standard wikicode for displaying an image, i.e.
[[Pilt:Example.jpg|100px]]
ülemine
A full-width cell displayed between the titlebar and first group/list, i.e. above the template's body (groups, lists and image). In a template without an image, above behaves in the same way as the list1 parameter without the group1 parameter.
alumine
A full-width cell displayed below the template's body (groups, lists and image). In a template without an image, below behaves in the same way as the template's final listn parameter without a groupn parameter. For an example of the below parameter in use, see {{Lists of the provinces and territories of Canada}}.

Stiilid

Styles are generally not recommended as to maintain consistency among templates and pages in Wikipedia. However, the option to modify styles is given.

päisestiil
CSS styles to apply to title, most often the titlebar's background color:
päisestiil = background:#nnnnnn;
päisestiil = background:name;
kehastiil
Specifies CSS styles to apply to the template body. The shorter name style may be used when no other style parameters are specified. This option should be used sparingly as it can lead to visual inconsistencies. Examples:
background:#nnnnnn;
width:N [em/%/px or width:auto];
float:[left/right/none];
clear:[right/left/both/none];
grupistiil
CSS styles to apply to the groupN cells. This option overrides any styles that are applied to the entire table. Examples:
background:#nnnnnn;
text-align:[left/center/right];
vertical-align:[top/middle/bottom];
loendistiil
CSS styles to apply to all lists. Overruled by the oddstyle and evenstyle parameters (if specified) below.
oddstyle
evenstyle
Applies to odd/even list numbers. Overrules styles defined by loendistiil. The default behavior is to add striped colors (white and gray) to odd/even rows, respectively, in order to improve readability. These should not be changed except in extraordinary circumstances.
üleminestiil
aluminestiil
CSS styles to apply to the top cell (specified via the above parameter) and bottom cell (specified via the below parameter). Typically used to set background color or text alignment:
background:#nnnnnn;
text-align:[left/center/right];
Vaikimisi stiilid

The style settings listed here are those that editors using the navbox change most often. The other more complex style settings were left out of this list to keep it simple.

päisestiil = background:#ccccff;
kehastiil = background:white; width:100%; vertical-align:middle;
üleminestiil = background:#ddddff; text-align:center;
aluminestiil = background:#ddddff; text-align:center;
grupistiil = background:#ddddff; text-align:right;
loendistiil = background:transparent; text-align:left/center;
oddstyle = background:transparent;
evenstyle = background:#f7f7f7;

Since loendistiil and oddstyle are transparent odd lists have the color of the kehastiil, which defaults to white. A list has text-align:left; if it has a group, if not it has text-align:center;. Since only kehastiil has a vertical-align all the others inherit its vertical-align:middle;.

Teised

olek   autocollapse, show, collapse  or  plain
Defaults to autocollapse. A navbox with autocollapse will start out collapsed if there are two or more tables on the same page that use other collapsible tables. Otherwise, the navbox will be expanded. For the technically minded, see MediaWiki:Common.js.
KUI SOOVID artiklis ÜHTE MALLI JÄTTA AVATUKS, SIIS KIRJUTA NII
{{malli nimi|olek = expanded}}
NÄITEKS {{Birgit Õigemeel|olek = expanded}}

MALLIS PEAB OLEMA SEL JUHUL olek = {{{olek|plain}}}

If set to collapsed, the navbox will always start out in a collapsed state.
If set to plain, the navbox will always be expanded with no [hide] link on the right.
If set to blank or anything other than autocollapse, collapsed or plain (such as "show"), the navbox will always start out in an expanded state, but have the "hide" button.
To show the box when standalone (non-included) but then auto-hide contents when in an article, put "show" inside <noinclude> tags:
olek = <noinclude>show</noinclude><includeonly>autocollapse</includeonly>
That double setting will force the box visible when standalone (even when followed by other boxes), displaying "[hide]" but then auto-collapse the box when stacked inside an article.
Often times, editors will want a default initial state for a nav box, which may be overridden in an article. Here is the trick to do this:
In your intermediate template, create a parameter also named "olek" as a pass-through like this:
| olek = {{{olek<includeonly>|your_desired_initial_state</includeonly>}}}
Example: {{peso}} with autocollapse as the default initial state. Bolivian peso transcludes it and has only one nav box. So the peso nav box shows. Chilean peso has two nav boxes. So the peso nav box collapses.
Example: {{Historical currencies of Hungary}} with expanded as the default initial state. All transcluding articles shows the content by default, unless there were an hypothetical article that specifies state = collapsed when transcluding.
The <includeonly>| will make the template expanded when viewing the template page by itself.
navbar
Defaults to Tnavbar. If set to plain, the v • d • e links on the left side of the titlebar will not be displayed. Currently, however, the title will also no longer be centered. See #Title centering below for a workaround.

tütar (child) kasutatakse alamtulpade loomisel.

Tabeli paigutus

Table generated by {{Navmall}} 'ilma pildita, ülemine või alumine parameters (borders added for illustration only)

Table generated by {{Navmall}} 'pildiga, ülemine and alumine parameters (borders added for illustration only)

Tabelis {{Navmall}} kasutatakse pilti, piltvasakul, loendeid aga ilma gruppideta, ülemise, alumise ribata.

Näited

Ilma pildita

{{Navmall
|nimi  = Navmall/doc
| päis = [[Eurovisiooni lauluvõistlus|Eurovisiooni]] võitjad
| grupp1 = 1950s
|  loend1 = [[Lys Assia]]{{·}} [[Corry Brokken]]{{·}} [[André Claveau]]{{·}} [[Teddy Scholten]]
| grupp2 = 1960s
|  loend2 = [[Jacqueline Boyer]]{{·}} [[Jean-Claude Pascal]]{{·}} [[Isabelle Aubret]]{{·}} [[Grethe and Jørgen Ingmann]]{{·}}[[Gigliola Cinquetti]]{{·}} [[France Gall]]{{·}} [[Udo Jürgens]]{{·}} [[Sandie Shaw]]{{·}} [[Massiel]]{{·}} [[Frida Boccara]]{{·}} [[Lenny Kuhr]]{{·}}[[Lulu (laulja)|Lulu]]{{·}} [[Salomé (laulja)|Salomé]]
| grupp3 = 1970s
|  loend3 = [[Dana Rosemary Scallon|Dana]]{{·}} [[Séverine (laulja)|Séverine]]{{·}} [[Vicky Leandros]]{{·}} [[Anne-Marie David]] {{·}}[[ABBA]]{{·}} [[Teach-In]]{{·}} [[Brotherhood of Man]]{{·}} [[Marie Myriam]]{{·}}[[Izhar Cohen]] & [[Alphabeta]]{{·}} [[Gali Atari]] & [[Milk and Honey]]
| grupp4 = 1980s
|  loend4 = [[Johnny Logan (laulja)|Johnny Logan]]{{·}} [[Bucks Fizz (bänd)|Bucks Fizz]]{{·}} [[Nicole (laulja)|Nicole]]{{·}}[[Corinne Hermès]]{{·}}[[Herreys]]{{·}} [[Bobbysocks]]{{·}} [[Sandra Kim]]{{·}} [[Johnny Logan (laulja)|Johnny Logan]]{{·}}[[Celine Dion]]{{·}}[[Riva (bänd)|Riva]]
| grupp5 = 1990s
|  loend5 = [[Toto Cutugno]]{{·}} [[Carola Häggkvist|Carola]]{{·}} [[Linda Martin]]{{·}}[[Niamh Kavanagh]]{{·}} [[Paul Harrington]] & [[Charlie McGettigan]]{{·}} [[Secret Garden (duo)|Secret Garden]]{{·}} [[Eimear Quinn]]{{·}} [[Katrina and the Waves]]{{·}} [[Dana International]]{{·}} [[Charlotte Perrelli|Charlotte Nilsson]]
| grupp6 = 2000s
|  loend6 = [[Olsen Brothers]]{{·}}[[Tanel Padar]], [[Dave Benton]] & [[Soul Militia|2XL]]{{·}}[[Marie N]]{{·}}[[Sertab Erener]]{{·}}[[Ruslana]]{{·}}[[Elena Paparizou]]{{·}} [[Lordi]]{{·}} [[Marija Šerifović]]
}}

Pildiga, ilma gruppideta

{{Navmall
|nimi  = Navmall/doc
|päis = [[Multimedia Super Corridor|MSC (Multimedia Super Corridor) Malaysia]]
|pilt = [[Pilt:Flag of Malaysia.svg|80px]]
|loend1 = [[Petronas Twin Towers]]{{·}} [[Kuala Lumpur Tower]]{{·}} [[Kuala Lumpur Sentral]]{{·}} [[Technology Park Malaysia]]{{·}} [[Putrajaya]]{{·}} [[Cyberjaya]]{{·}} [[Kuala Lumpur International Airport]]
}}

With two images, without groups, multiple lists

{{Navmall
|nimi  = Navmall/doc
|päis = [[Multimedia Super Corridor|MSC (Multimedia Super Corridor) Malaysia]]
|pilt = [[Image:Flag of Malaysia.svg|80px]]
|piltvasakul = [[Image:Flag of Malaysia.svg|80px]]
|loend1 = [[Petronas Twin Towers]]{{·}} [[Kuala Lumpur Tower]]{{·}} [[Kuala Lumpur Sentral]]
|loend2 = [[Express Rail Link]]{{·}} [[KL-KLIA Dedicated Expressway]]
|loend3 = [[EGovernment]]{{·}} [[MyKad]]
|loend4 = [[Klang Valley]]
}}


With image, groups, above, below

{{Navmall
|nimi  = Navmall/doc
|päis = [[Multimedia Super Corridor|MSC (Multimedia Super Corridor) Malaysia]]
|pilt = [[Image:Flag of Malaysia.svg|80px]]

|ülemine = Above text goes here

|grupp1 = Centre
|loend1  = [[Cyberjaya]]

|grupp2 = Area
|loend2  = [[Klang Valley]]

|grupp3 = Major landmarks
|loend3  = [[Petronas Twin Towers]]{{·}} [[Kuala Lumpur Tower]]{{·}} [[Kuala Lumpur Sentral]]{{·}} [[Technology Park Malaysia]]{{·}} [[Putrajaya]]{{·}} [[Cyberjaya]]{{·}} [[Kuala Lumpur International Airport]]

|grupp4 = Infrastructure
|loend4  = [[Express Rail Link]]{{·}} [[KL-KLIA Dedicated Expressway]]

|grupp5 = Prime applications
|loend5  = [[EGovernment]]{{·}} [[MyKad]]

|alumine  = Website: [http://www.msc.com.my/ www.msc.com.my]
}}

Title centering

If either the navbar (v • a • r lingid) või [näita]/[peida] on disabled, then the title is not centered:

This can be resolved by padding the title with {{pad|5.5em}} on the right or left:

Note that omitting both the [näita]/[peida] link and the navbar has no effect on the title centering, as follows:

Vaata ka


Navigeerimismallide võrdlus
Kokkupandav Päise värvus Pilt Grupid Stiil (sisu)
parameter/s
Näited
{{Navmall}} kokkupandav (collapsible) navbox Sisust vasakule/paremale Jah Jah
{{Navmall veergudega}} kokkupandav (collapsible) navbox Veerudest vasakule/paremale Ei Jah
The background color for the header or title is inherited from the class listed below. The templates have titlestyle parameters that can be used to override the default.
Collapsible attributes
Tüüp CSS klassid Millal kokkupandud Custom
initial state
Nesting Vaikimisi
päise värvus
Kirja suurus
kokkupandav kokkupandav (collapsible) 2 või enam autocollapse lehte Jah Jah #ccf 90%