Mudanças

Ir para navegação Ir para pesquisar

Predefinição:Tmbox/doc

12 289 bytes adicionados, 08h25min de 21 de dezembro de 2019
Criação da Documentação da Predefinição Tmbox.
<sub>Texto em subscrito</sub><noinclude>{{Em tradução}}</noinclude>
{{Subpágina de documentação}}
<!-- POR FAVOR, ADICIONE CATEGORIAS NO FINAL DESTA PÁGINA -->

<includeonly>{{Alto risco| 185000 }}</includeonly>

{{mbox templates}}
Esta é a metapredefinição {{Lp|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 {{Lp|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.
<!--
Estas predefinições normalmente não devem ser utilizadas para o WikiProjeto banners. Eles têm necessidades especiais e, portanto, têm as suas próprias metapredefinições. Na seção "Ver também" abaixo, poderá ver as ligações.
-->
Esta predefinição trabalha de forma similar ao {{Lp|ambox}} e utiliza os mesmos parâmetros.
<!--
=== Estamos implantando! ===

After discussions on the [[Template talk:Tmbox|página de discussão]] of this template and announcing it at several places for some time we are now deploying this template. Feel free to convert any message boxes used on talk pages to use this meta-template. If you find any tricky cases then list them on the talk page of this template and you'll get help.

When this template is used to build talk page message boxes those boxes should contain explanatory texts just like before. (The same texts as before or new improved texts.) If there are more specific images in the boxes or you know a better image, then use them instead of the default images shown here.

=== Suggested style standard ===

The types of talkpage messageboxes follow the same naming convention as the boxes for all other namespaces, but the type of any particular talkpage messagebox may not be as obvious as in other namespaces. When deciding on the type to use for a talkpage messagebox, please consider the following guidelines:
* '''speedy''' should ''only'' be used for [[:Category:Speedy deletion templates|speedy deletion templates]].
* '''delete''' should ''only'' be used for templates relating to ''ongoing'' deletion discussions. Please do ''not'' use this type just to get a red border for a messagebox.
* '''content''' and '''style''' should be used for warnings and alerts. Use '''content''' (which has an orange border) for more important and immediate alerts, and '''style''' (yellow border) for less important warnings. Messageboxes of these types should ideally be ''transitory'': they should not be expected to remain on a talkpage indefinitely.
* '''move''' and '''protection''' should only be used for messageboxes relating to moves and merges, and page protection, respectively.
* The '''notice''' type should be used for the majority of talkpage messageboxes; those that are intended to convey or summarise information. If a talkpage messagebox does not obviously fit into one of the other types, it is probably a notice type.
-->
== Uso ==

Exemplo básico:

<pre>
{{tmbox | texto = ALgum texto.}}
</pre>

{{tmbox | texto = Algum texto.}}


Exemplo complexo:

<pre>
{{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.
}}
</pre>

{{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.

{{tmbox
| tipo = eliminação rápida
| texto = tipo=<u>eliminação rápida</u> – Indicações à [[Wikihelp:eliminação rápida|eliminação rápida]].
}}
{{tmbox
| tipo = eliminação
| texto = tipo=<u>eliminação</u> – Outras indicações a [[Wikihelp:eliminação|eliminação]].
}}
{{tmbox
| tipo = conteúdo
| texto = tipo=<u>conteúdo</u> – Avertências a problemas graves.
}}
{{tmbox
| tipo = estilo
| texto = tipo=<u>estilo</u> – Advertências a problemas simples.
}}
{{tmbox
| tipo = notícia
| texto = tipo=<u>notícia</u> – Avisos e mensagens de qualquer tipo, tanto permanentes como temporárias.
}}
{{tmbox
| tipo = mover
| texto = tipo=<u>mover</u> – Propostas para [[Wikihelp:Fusão|fundir]], dividir ou renomear.
}}
{{tmbox
| tipo = proteção
| texto = tipo=<u>proteção</u> – Avisos de [[WP:PP|proteções]].
}}

=== Especial ===

Combinações de alguns outros parâmetros.

{{tmbox
| texto = Sem tipo e nenhuma imagem dada ('''padrão''')
}}
{{tmbox
| imagem = nenhuma
| texto = Sem tipo e '''imagem=nenhuma''' – Nenhuma imagem é utilizada, e o '''texto''' utiliza toda a área da caixa de mensagem.
}}
{{tmbox
| imagem = [[Imagem:Gnome globe current event.svg|42px]]
| imagem_direita = [[Imagem:Nuvola apps bookcase.svg|40px]]
| texto = imagem = <nowiki>[[Imagem:Gnome globe current event.svg|42px]]</nowiki> <br> imagem_direita = <nowiki>[[Imagem:Nuvola apps bookcase.svg|40px]]</nowiki>
}}

=== Parâmetros ===

Lista de todos parâmetros:

<pre>
{{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.
}}
</pre>

'''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:
::<code><nowiki>image = [[Image:Crystal package settings.png|40px]]</nowiki></code>
:'''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:
::<code><nowiki>imageright = [[Imagem:Nuvola apps bookcase.png|40px]]</nowiki></code>
:'''Anything''' = Any other object that you want to show on the right side.

'''estilo'''
:Optional [[Cascading Style Sheets|CSS]] values used by the entire message box table. Without quotation marks <code>" "</code> but with the ending semicolons <code>;</code>. For example:
::<code>style = margin-bottom: 0.5em;</code>

'''textstyle'''
:Optional [[Cascading Style Sheets|CSS]] values used by the text cell. For example:
::<code>textstyle = text-align: center;</code>

'''texto'''
:The message body text.

==== The small parameters ====

{{tmbox
| small = yes
| texto = small = yes
}}
{{tmbox
| tipo = estilo
| small = yes
| texto = tipo = estilo <br> small = yes
}}
'''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:
::<code><nowiki>small = {{{small|}}}</nowiki></code>

{{tmbox
| small = yes
| imagem = [[Image:Nuvola apps bookcase.png|40px]]
| smallimage = [[Image:Nuvola apps bookcase.png|30px]]
| text =
small = yes <br> imagem = <nowiki>[[Image:Nuvola apps bookcase.png|40px]]</nowiki> <br> smallimage = <nowiki>[[Image:Nuvola apps bookcase.png|30px]]</nowiki>
}}
'''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:
::<code><nowiki>smallimage = [[Image:Crystal package settings.png|30px]]</nowiki></code>
:'''none''' = Means that no image is used. This overrides any image fed to '''image''', when "small=yes".

{{tmbox
| small = yes
| imageright = [[Image:Nuvola apps bookcase.png|40px]]
| text =
small = yes <br> imageright = <nowiki>[[Image:Nuvola apps bookcase.png|40px]]</nowiki>
}}
{{tmbox
| small = yes
| imageright = [[Image:Nuvola apps bookcase.png|30px]]
| smallimageright = none
| text =
small = yes <br> imageright = <nowiki>[[Image:Nuvola apps bookcase.png|40px]]</nowiki> <br> smallimageright = none
}}

'''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:
::<code><nowiki>smallimageright= [[Image:Nuvola apps bookcase.png|30px]]</nowiki></code>
:'''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:

<pre>
{{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 &lt;nowiki>}}&lt;/nowiki>.
And now a pipe and end braces &lt;nowiki>|}}&lt;/nowiki>.
</div>
}}
</pre>

{{tmbox
| texto = <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 {{tl|tmbox/core}} que mantém a maior parte do código para {{tl|tmbox}}, enquanto a {{tl|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 [[m:Help:ParserFunctions|parser functions]] e os caracteres especiais em parâmetros.

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

== Ver também ==
{{Mbox templates see also}}

Outras páginas:
* [[Wikihelp:!Predefinições de página de discussão]] – A orientação especificando os estilos de caixas de mensagem para página de discussão.

WikiProjeto banners:
* {{tl|WikiProjectBannerShell}} e {{tl|WPBannerMeta}} – A system for collapsing, wrapping and creating WikiProjeto banners.
* {{tl|WikiProjeto Banners}} [[Predefinição:BannerWP]] – Another system for collapsing WikiProject banners.

<includeonly>
<!-- CATEGORIAS E INTERWIKIS AQUI, OBRIGADO -->
[[Categoria:!Metapredefinições]]

</includeonly>

Menu de navegação