Predefinição:Tmbox/doc

Origem: IRChelp Brasil - Wiki
Ir para navegação Ir para pesquisar

Texto em subscrito


Esta é a metapredefinição {{tmbox}} ou caixa de mensagem para página de discussão.

É usada para construir predefinições de caixa de mensagem para páginas de discussão, como {{AvançarDiscussão}} etc. Oferece diversas cores diferentes e utiliza imagens padrão, caso nenhuma imagem parâmetro seja determinada, e tem algumas outras funções. Esta predefinição trabalha de forma similar ao {{ambox}} e utiliza os mesmos parâmetros.

Uso

Exemplo básico:

{{tmbox | texto = ALgum texto.}}


Exemplo complexo:

{{tmbox
| tipo         = estilo
| imagem       = [[Imagem:Emblem-question-yellow.svg|40px]]
| estilo       = width: 400px; 
| textstyle    = color: red; font-weight: bold; font-style: italic;
| texto        = The message body text.
}}

Tipos de caixas de mensagem para página de discussão

Os exemplos seguintes usam diferentes parâmetros tipo mas não usam parâmetros de imagem, assim eles usam o padrão de imagens para cada tipo.

Especial

Combinações de alguns outros parâmetros.

Parâmetros

Lista de todos parâmetros:

{{tmbox
| tipo           = eliminação rápida / eliminação / conteúdo / estilo / notícia / mover / proteção
| imagem         = nenhuma / [[Imagem:Some image.svg|40px]]
| imagem_direita = [[Imagem:Some image.svg|40px]]
| estilo         = CSS values
| textstyle      = CSS values
| texto          = O corpo da mensagem texto. 
| small          = {{{small|}}} / yes
| smallimage     = nenhuma / [[Imagem:Some image.svg|30px]]
| smallimageright= nenhuma / [[Imagem:Some image.svg|30px]]
| smalltext      = Uma curta mensagem corpo do texto.
}}

tipo

Se não tiver parâmetro tipo é dado à predefinição o padrão tipo notícia. Isso significa que ela recebe uma borda cinza.

imagem

No parameter = Se não tiver parâmetro imagem é dada à predefinição usar uma imagem padrão. Qual imagem padrão ele usa, depende do parâmetro type.
An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (But the message box can handle images of any size.) For example:
image = [[Image:Crystal package settings.png|40px]]
none = Means that no image is used.

imageright

No parameter = If no imageright parameter is given then no image is shown on the right side.
An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (But the message box can handle images of any size.) For example:
imageright = [[Imagem:Nuvola apps bookcase.png|40px]]
Anything = Any other object that you want to show on the right side.

estilo

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;

textstyle

Optional CSS values used by the text cell. For example:
textstyle = text-align: center;

texto

The message body text.

The small parameters

small

yes = Makes it a smaller right floating message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=yes". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}

smallimage

No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
An image = Should be an image with usual wiki notation. 30px width is usually about right. For example:
smallimage = [[Image:Crystal package settings.png|30px]]
none = Means that no image is used. This overrides any image fed to image, when "small=yes".

smallimageright

No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
An image = Should be an image with usual wiki notation. 30px width is usually about right. For example:
smallimageright= [[Image:Nuvola apps bookcase.png|30px]]
Anything = Any other object that you want to show on the right side.
none = Means that no right side image is used. This overrides any image fed to imageright, when "small=yes".

smalltext

A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.

Technical details

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

{{tmbox
| 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>
}}

Esta predefinição usa a tmbox CSS classes no MediaWiki:Common.css para a maior parte da sua aparência, portanto, é plenamente skinnable.

Esta predefinição, chama a {{tmbox/core}} que mantém a maior parte do código para {{tmbox}}, enquanto a {{tmbox}} faz o pré-processamento de parâmetro ela mesmo.

Internamente esta metapredefinição usa HTML markup em vez da wiki markup, para o código da tabela. Essa é a maneira usual que fazemos metapredefinições uma vez que wiki markup tem vários inconvenientes. Por exemplo, torna mais difícil de usar parser functions e os caracteres especiais em parâmetros.

Para mais detalhes técnicos ver a página de discussão. Uma vez que esta predefinição, funciona quase exatamente como ((tl|ambox)), {{imbox}}, {{cmbox}} e {{ombox}} suas páginas de discussão e páginas relacionadas podem também conter mais informações.

Ver também

Predefinição:Mbox templates see also

Outras páginas:

WikiProjeto banners: