Redigerer
Mal:Navbox/dok
(avsnitt)
Hopp til navigering
Hopp til søk
Advarsel:
Du er ikke innlogget. IP-adressen din vil bli vist offentlig om du redigerer. Hvis du
logger inn
eller
oppretter en konto
vil redigeringene dine tilskrives brukernavnet ditt, og du vil få flere andre fordeler.
Antispamsjekk.
Ikke
fyll inn dette feltet!
=== Setup parameters === :; ''name''* :: The name of the template, which is needed for the "V • T • E" ("View • Talk • Edit") links to work properly on all pages where the template is used. You can enter <code><nowiki>{{subst:PAGENAME}}</nowiki></code> for this value as a shortcut. The name parameter is only mandatory if a <code>title</code> is specified, and the <code>border</code> parameter is not set, and the <code>navbar</code> parameter is not used to disable the navbar. :; ''state''* <span style="font-weight:normal;">[<code>autocollapse, collapsed, expanded, plain, off</code>]</span> :* Defaults to <code>autocollapse</code>. A navbox with <code>autocollapse</code> will start out collapsed if there are two or more collapsible elements on the same page. Otherwise, the navbox will be expanded. For the technically minded, see [[MediaWiki:Common.js]] (search for "autocollapse"). :* If set to <code>collapsed</code>, the navbox will always start out in a collapsed state. :* If set to <code>expanded</code>, the navbox will always start out in an expanded state. :* If set to <code>plain</code>, the navbox will always be expanded with no [hide] link on the right, and the title will remain centered (by using padding to offset the <small>V • T • E</small> links). :* If set to <code>off</code>, the navbox will always be expanded with no [hide] link on the right, but no padding will be used to keep the title centered. This is for advanced use only; the "plain" option should suffice for most applications where the [show]/[hide] button needs to be hidden. : To show the box when standalone (non-included) but then auto-hide contents when in an article, put "expanded" inside {{tag|noinclude|p}} tags. This setting will force the box visible when standalone (even when followed by other boxes), displaying "[hide]", but then it will auto-collapse the box when stacked inside an article: :: <code><nowiki>| state = </nowiki></code>{{tag|noinclude|content=expanded}} : Often times, editors will want a default initial state for a navbox, which may be overridden in an article. Here is the trick to do this: :* In your intermediate template, create a parameter also named "state" as a pass-through like this: :: <code><nowiki>| state = {{{state<includeonly>|your_desired_initial_state</includeonly>}}}</nowiki></code> :* The {{tag|includeonly|o}}<code>|</code> will make the template expanded when viewing the template page by itself. ::* Example 1: {{tl|Peso}} with ''autocollapse'' as the default initial state. [[Catalan peseta]] transcludes it and has only one navbox; thus, the peso navbox shows. [[Chilean peso]] has more than two navboxes; thus, the peso navbox collapses. ::* Example 2: {{tl|Historical currencies of Hungary}} with ''expanded'' as the default initial state, as such: :::<code><nowiki>| state = {{{state<includeonly>|expanded</includeonly>}}}</nowiki></code> :::All transcluding articles show the content by default, unless there is a hypothetical article that specifies <code><nowiki>{{templatename|state=collapsed}}</nowiki></code> when transcluding. ::* Example 3: {{tl|Tourism}} with ''collapsed'' as the default initial state, as such: :::<code><nowiki>| state = {{{state<includeonly>|collapsed</includeonly>}}}</nowiki></code> :::All transcluding articles will show the template as collapsed by default, but the template will still be uncollapsed when displayed on its own page. :* The template {{tl|Collapsible option}} explains how to use the <code>state</code> parameter. It can be added to a {{tag|noinclude|p}} section after the template definition or to the instructions on the {{tl|documentation subpage}}. :; ''navbar''* :: If set to <code>plain</code>, the <span style="font-size: 88%;">V • T • E</span> links on the left side of the titlebar will not be displayed, and padding will be automatically used to keep the title centered. Use <code>off</code> to remove the <span style="font-size: 88%;">V • T • E</span> links, but not apply padding (this is for advanced use only; the "plain" option should suffice for most applications where a navbar is not desired). It is highly recommended that one not hide the navbar, in order to make it easier for users to edit the template, and to keep a standard style across pages. :; ''border''* :: ''See later section on [[#Child navboxes|using navboxes within one another]] for examples and a more complete description.'' If set to <code>child</code> or <code>subgroup</code>, then the navbox can be used as a borderless child that fits snugly in another navbox. The border is hidden and there is no padding on the sides of the table, so it fits into the ''list'' area of its parent navbox. If set to <code>none</code>, then the border is hidden and padding is removed, and the navbox may be used as a child of another container (do not use the <code>none</code> option inside of another navbox; similarly, only use the <code>child</code>/<code>subgroup</code> option inside of another navbox). If set to anything else (default), then a regular navbox is displayed with a 1px border. An alternate way to specify the border to be a subgroup style is like this (i.e. use the first unnamed parameter instead of the named ''border'' parameter): ::: <code><nowiki>{{Navbox|child</nowiki></code> :::: <code>...</code> ::: <code><nowiki>}}</nowiki></code>
Redigeringsforklaring:
Merk at alle bidrag til Wikisida.no anses som frigitt under Creative Commons Navngivelse-DelPåSammeVilkår (se
Wikisida.no:Opphavsrett
for detaljer). Om du ikke vil at ditt materiale skal kunne redigeres og distribueres fritt må du ikke lagre det her.
Du lover oss også at du har skrevet teksten selv, eller kopiert den fra en kilde i offentlig eie eller en annen fri ressurs.
Ikke lagre opphavsrettsbeskyttet materiale uten tillatelse!
Avbryt
Redigeringshjelp
(åpnes i et nytt vindu)
Forhåndsvis en side som bruker denne malen
Denne siden er medlem av 1 skjult kategori:
Kategori:Sider hvor ekspansjonsdybden er overskredet
Navigasjonsmeny
Personlige verktøy
Ikke logget inn
Brukerdiskusjon
Bidrag
Opprett konto
Logg inn
Navnerom
Mal
Diskusjon
norsk bokmål
Visninger
Les
Rediger kilde
Vis historikk
Mer
Navigasjon
Forside
Siste endringer
Tilfeldig side
Hjelp til MediaWiki
Verktøy
Lenker hit
Relaterte endringer
Spesialsider
Sideinformasjon