Mal:Amboks

Denne malen er beskyttet.
Fra Wikipedia, den frie encyklopedi
Maldokumentasjon


Dette er {{amboks}} eller artikkelmeldingsboks-metamalen.

Malen brukes for å bygge meldingsbokser som skal plasseres i artikler, slik som {{Fremtidig programvare}}.

Malen bruker CSS-klassene ambox i MediaWiki:Common.css. Disse klassene kan også brukes direkte i en wikitabell ved behov. Se how-to guide for mer info.

Bruk

Enkelt eksempel:

{{Amboks | tekst = Litt tekst.}}

Litt mer komplisert eksempel:

{{Amboks
| type       = style
| bilde      = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]]
| tekst      = Text for a big box, for the top of articles.
}}

Ulike bokstyper

De følgende eksemplene bruker forskjellige type parameter:

Andre bilder

I eksemplene ovenfor brukes standardbilder for hver type. I eksemplene under er bilder spesifisert eksplisitt.

Flere eksempler

Parametere

Liste over parametere:

{{Amboks
| type        = speedy / delete / content / style / notice / move / protection
| bilde       = none / [[Fil:...|40px|...]]
| bildehøyre  = [[Fil:...|40px|...]]
| style       = CSS values
| tekst        = The message body text.
}}
type
Hvis ingen type spesifiseres, brukes notice som default.
bilde
Ikke satt = Hvis bilde ikke spesifiseres bruker malen et standardbilde basert på type.
Et bilde = Bruk standard wikimarkup. Bredde på 40px - 50px er vanligvis passe. (Bilder større enn 52 pixler brede kan skape problemer med padding.)
Ofte er ikoner kun dekorative i betydningen av at de ikke tilfører informasjon utover det som står i teksten. For å øke tilgjengeligheten anbefales det å merke bildet med at det ikke skal leses opp av skjermlesere. Hvis bildelisensen tillater det, kan du angi link=|alt= slik:
bilde = [[File:Unbalanced scales.svg|40px|link=|alt=]]
Alternativt bør du angi en meningsfylt alternativ tekst.
bildehøyre
Ikke satt = Hvis bildehøyre ikke spesifiseres vil det ikke vises noe bilde på høyre side.
Et bilde = Bruk standard wikimarkup. Bredde på 40px - 50px er vanligvis passe. (Bilder større enn 52 pixler brede kan skape problemer med padding.) For eksempel:
bildehøyre = [[Fil:Nuvola apps bookcase.png|40px|alt=Tre stablede bøker]]
style
Optional CSS values used by the entire message box table. Without quotation marks " " but with the ending semicolons ;. For example:
style = margin-bottom: 0.5em;
tekst

Tekniske detaljer

Spesialtegn kan escapes slik:

{{Amboks
| tekst  = <div>
Equal sign = and a start and end brace { } work fine as they are.
But here is a pipe &#124; and two end braces <nowiki>}}</nowiki>.
And now a pipe and end braces <nowiki>|}}</nowiki>.
</div>
}}

The <div> tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.

Internally this meta-template uses HTML markup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.

The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.