Template:Fmbox

Questa pagina è protetta dallo spostamento
Questa pagina è protetta
Da Wikivoyage.


Template protetto – Le modifiche possono essere proposte nella pagina di discussione.
Info Istruzioni per l'uso
Le istruzioni che seguono sono contenute nella sottopagina Template:Fmbox/man (modifica · cronologia)
Sandbox: Template:Fmbox/Sandbox (modifica · cronologia) · Styles: Template:Fmbox/styles.css (modifica · cronologia) · Tutte le sottopagine: lista

Questo è il template {{fmbox}} o avviso di fondo pagina e intestazione.

Può essere utilizzato per creare avvisi per i messaggi di sistema come MediaWiki:Sp-contributions-footer-anon. Può anche essere utilizzato per messaggi di fondo pagina e intestazioni su pagine utente e per avvisi di modifica.

Uso

Uso semplice:

{{fmbox | text = Del testo.}}


Uso completo:

{{fmbox
| type      = editnotice
| image     = [[File:Emblem-question-yellow.svg|40px]]
| style     = border: 1px solid #f4c430;
| textstyle = color: red; font-weight: bold; font-style: italic;
| text      = Il corpo del testo del messaggio.
}}


Tipi

I seguenti esempi usano differenti tipi di parametri, ma non usano i parametri delle immagini e quindi mostrano le immagini predefinite per ogni tipo.




Con altre immagini

Le immagini di default sopra riportate sono per lo più utilizzate nei test e dimostrazioni. Nella maggior parte dei casi è più opportuno utilizzare un'immagine più specifica o nessuna immagine. Questi esempi utilizzano il parametro image per specificare un'immagine diversa da quella predefinita.


Speciale

Alcune combinazioni di altri parametri.


Parametri

Elenco di tutti i parametri

{{fmbox
| type       = system / editnotice / warning
| image      = none / [[File:Immagine.svg|40px]]
| imageright = [[File:Immagine.svg|40px]]
| id         = id CSS
| class      = nome classe CSS
| style      = valori CSS
| textstyle  = valori CSS
| text       = Il corpo del testo del messaggio.
}}

type

Se non viene inserito nessun parametro type il template usa automaticamente il tipo system. Questo significa che si avrà uno sfondo grigio chiaro.

image

Nessun parametro = Se non viene inserito nessun parametro image il template usa l'immagine predefinita. Questo significa che l'immagine predefinita dipenderà dal parametro del type scelto.
Un'immagine = Usa un immagine con la solita sintassi wiki. La larghezza consentita è compresa tra 40px e 50px. (Tuttavia l'avviso supporta immagini di ogni dimensione.) Per esempio:
image = [[File:User-info.svg|40px]]
none = Significa che non verrà usata nessun'immagine sul lato sinistro dell'avviso.

imageright

Nessun parametro = Se non viene inserito nessun parametro imageright non verrà mostrata nessun immagine sul lato destro dell'avviso.
Un'immagine = Usa un immagine con la solita sintassi wiki. La larghezza consentita è compresa tra 40px e 50px. (Tuttavia l'avviso supporta immagini di ogni dimensione.) Per esempio:
imageright = [[File:Nuvola apps bookcase.png|40px]]
Qualsiasi cosa = Qualsiasi altro oggetto che si desidera visualizzare sul lato destro.

id

Un nome id JS opzionale è utilizzato dall'intera tabella dell'avviso. Senza virgolette " ". Gli id sono solitamente destinati a contrassegnare un'avviso con il suo nome per rendere più facile rilevare la presenza dell'avviso da javascript. Per esempio MediaWiki:Sp-contributions-footer dovrebbe usare:
id = sp-contributions-footer

class

Un nome class CSS opzionale è utilizzato dall'intera tabella dell'avviso. Senza virgolette " ". Le classi sono solitamente destinate a contrassegnare un'avviso con il suo nome per rendere più facile rilevare la presenza dell'avviso dai css. Per esempio MediaWiki:Sp-contributions-footer dovrebbe usare:
class = sp-contributions-footer

style

Un valore style CSS opzionale è utilizzato dall'intera tabella dell'avviso. Senza virgolette " " ma che finisca con il punto-e-virgola ;. Per esempio:
style = margin-top: 1em;

textstyle

Un valore textstyle CSS opzionale è utilizzato dalla cella del testo. Per esempio:
textstyle = font-size: 90%; text-align: center;

text

Il corpo del testo del messaggio.

Avvisi di modifica

Pagina
Namespace
Protezione
Dettagli tecnici (EN)
This template currently uses hard coded styles and class names. Later it will only use CSS classes making it easier to skin. (In the meantime it can be skinned by using the "!important" keyword.)

If you need to make a box that is less than 100% wide, then do not use this box, instead use the {{ombox}}. Since this box doesn't have the "1px empty image cell" code that makes it so the other mboxes get proper box flow in all browsers when less than 100% wide.

If you need to use special characters in the text parameter then you need to escape them like this:

{{fmbox
| text  = <div>
Equal sign = and a start and end brace { } work fine as they are. 
But here is a pipe {{!}} and two end braces <nowiki>}}</nowiki>. 
And now a pipe and end braces <nowiki>|}}</nowiki>.
</div>
}}



Internally this meta-template uses HTML wikimarkup 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.

Note to admins: MediaWiki does not parse and convert HTML wikimarkup in system messages the same way as it does for normal pages. This means for instance that <br> is not automatically converted to <br /> and missing </td> and </tr> tags are not automatically added. Thus see to that any HTML code you use in system messages are valid XHTML. That is, close all tags that you begin. However, regular wikimarkup works fine in most system messages.