Abrir menu principal

Mudanças

Predefinição:Imbox/doc

9 722 bytes adicionados, 10h25min de 21 de dezembro de 2019
Criação da Documentação da Predefinição Imbox.
<noinclude>{{Em tradução}}</noinclude>
{{subpágina de documentação}}
<!-- POR FAVOR, ADICIONE CATEGORIAS E INTERWIKIS NO FINAL DESTA PÁGINA -->
{{mbox templates}}
Esta é a {{tl|imbox}} ou '''caixa de mensagem para imagem''' meta-template.

== Uso ==

É usada para construir predefinições de caixa de mensagem para páginas de ficheiro (imagem) tal como {{tl|cleanup-image}} etc. Ela oferece várias cores diferentes, usa imagens padrão caso nenhum parâmetro de imagem for determinado e tem algumas outras características.

Esta predefinição funciona quase exatamente como ((tl|ambox}} e usa os mesmos parâmetros.

===Estamos implantando!!===

Depois de longa discussão na página de discussão desta predefinição e em outros lugares, estamos finalizando a implantação desta predefinição. Sinta-se livre para converter todas as caixas de mensagens usadas em páginas de arquivo para usar esta meta-predefinição. Se você encontrar quaisquer casos complicados, então inclua na página de discussão desta predefinição e você receberá ajuda.

Quando esta predefinição é utilizada para criar caixas de mensagens de imagem, as caixas devem conter textos explicativos como antes (Os mesmos textos como antes, ou novos textos melhorados). Se houver imagens mais específicas nas caixas ou você conhece uma imagem melhor, então use-as em vez das imagens padrão mostradas aqui.

=== Exemplos ===

Exemplo de uso simples:

<pre>
{{imbox | text = Qualquer texto.}}
</pre>

{{imbox | text = Qualquer texto.}}


Exemplo complexo:

<pre>
{{imbox
| type = style
| image = [[Imagem:Emblem-question-yellow.svg|40px]]
| style = width: 400px;
| textstyle = color: red; font-weight: bold; font-style: italic;
| text = Texto da mensagem.
}}
</pre>

{{imbox
| type = style
| image = [[Imagem:Emblem-question-yellow.svg|40px]]
| style = width: 400px;
| textstyle = color: red; font-weight: bold; font-style: italic;
| text = Texto da mensagem.
}}

=== Tipos de caixa de mensagens imagem ===

Os exemplos a seguir usam diferentes parâmetros '''type''' mas não usa parâmetros imagem assim, eles usam as imagens padrão para cada tipo.

{{imbox
| type = speedy
| text = type=<u>speedy</u> – Speedy deletion templates such as {{tl|isd}}.
}}
{{imbox
| type = delete
| text = type=<u>delete</u> – Deletion templates such as {{tl|ifd}}.
}}
{{imbox
| type = content
| text = type=<u>content</u> – Major warnings and problems, such as {{tl|non-free reduce}}.
}}
{{imbox
| type = style
| text = type=<u>style</u> – Minor warnings and problems, such as {{tl|cleanup-image}}.
}}
{{imbox
| type = notice
| text = type=<u>notice</u> – Notices and messages of any kind, both permanent and temporary.
}}
{{imbox
| type = move
| text = type=<u>move</u> – Move and rename messages and proposals, such as {{tl|rename media}}.
}}
{{imbox
| type = protection
| text = type=<u>protection</u> – Protection templates such as {{tl|pp-protected}} when shown on an image page.
}}
{{imbox
| type = license
| text = type=<u>license</u> – License templates such as {{tl|GFDL}}.
}}
{{imbox
| type = featured
| text = type=<u>featured</u> – Featured image templates such as {{tl|FeaturedPicture}}.
}}

=== Outras imagens ===

As imagens padrão mostradas acima são em sua maioria por conveniência. Em muitos casos, é mais adequado utilizar imagens mais específicas. Estes exemplos usam o parâmetro '''image''' para especificar uma imagem diferente das imagens padrão.

{{imbox
| type = style
| image = [[Image:Gnome-dev-camera.svg|42px]]
| text = type = style <br> image = <nowiki>[[Image:Gnome-dev-camera.svg|42px]]</nowiki> <br> Esta imagem é usada para {{tl|cleanup-image}}.
}}
{{imbox
| type = move
| image = [[Image:To Commons.svg|52px]]
| text = type = move <br> image = <nowiki>[[Image:To Commons.svg|52px]]</nowiki> <br> Esta imagem é usada para {{tl|copy to Wikimedia Commons}}.
}}
{{imbox
| type = license
| image = [[Image:Heckert GNU white.svg|48px]]
| text = type = license <br> image = <nowiki>[[Image:Heckert GNU white.svg|48px]]</nowiki> <br> Esta imagem é usada pelas predefiniçõesde licença GFDL como {{tl|GFDL}}.
}}

=== Special ===

Some other parameter combinations.

{{imbox
| text = No type and no image given ('''default''')
}}
{{imbox
| image = none
| text = No type and '''image=none''' – No image is used and the '''text''' uses the whole message box area.
}}

{{imbox
| type = license
| image = [[Image:Imbox license.svg|40px]] <br> [[Image:Ambox warning yellow.svg|40px]]
| imageright = [[Image:Shuttle.svg|30px]]
| text = type = license <br> image = <nowiki>[[Image:Imbox license.svg|40px]] &lt;br> [[Image:Ambox warning yellow.svg|40px]]</nowiki> <br> imageright = <nowiki>[[Image:Shuttle.svg|30px]]</nowiki>
}}

{{imbox
| type = license
| image = [[Image:Imbox license.svg|40px]] <br> [[Image:Ambox warning yellow.svg|40px]]
| imageright = [[Image:Shuttle.svg|30px]]
| text = '''This file is in the [[public domain]] because it was created by [[NASA]].'''
<br>Note that use of NASA logos, insignia and emblems are restricted per US law.
}}

{{imbox
| type = license
| image = [[Image:Imbox license.svg|40px]]
| text =
type = license <br> image = <nowiki>[[Image:Imbox license.svg|40px]]</nowiki> <br> below = <nowiki>{{imbox | type = content | text = '''This license tag is deprecated!''' }}</nowiki>
| below =
{{imbox
| type = content
| text = '''This license tag is deprecated!'''
}}
}}

=== Parâmetros ===

Lista de todos parâmetros:

<pre>
{{imbox
| type = speedy / delete / content / style / notice /
move / protection / license / featured
| image = none / [[Image:Some image.svg|40px]]
| imageright = [[Image:Some image.svg|40px]]
| style = CSS value
| textstyle = CSS value
| text = The message body text.
| below = More text or another imbox.
}}
</pre>

'''type'''
:If no '''type''' parameter is given the template defaults to type '''notice'''. That means it gets a blue border.

'''image'''
:'''No parameter''' = If no '''image''' parameter is given the template uses a default image. Which default image it uses depends on the '''type''' parameter.
:'''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:Gnome-dev-camera.svg|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 = [[Image:Nuvola apps bookcase.png|40px]]</nowiki></code>
:'''Anything''' = Any other object that you want to show on the right side.

'''style'''
:An optional [[Cascading Style Sheets|CSS]] value used by the entire message box table. Without quotation marks <code>" "</code>. For example:
::<code>style = margin-bottom: 0.5em;</code>

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

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

'''below'''
:A full width area below the images and text area. Can take a text or any kind of object, for instance another imbox:
::<code><nowiki>below = {{imbox | type = content | text = This license tag is deprecated. }} </nowiki></code>

=== Technical details ===

Namespace "Image:" was renamed to "File:" on 11 December 2008. This template was created long before that, and that is why it is named "imbox" as in "image message box".

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

<pre>
{{imbox
| 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>

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

This template uses the imbox CSS classes in [[MediaWiki:Common.css]] for most of its looks, thus it is fully skinnable.

Internally this meta-template uses HTML markup instead of wiki markup for the table code. That is the usual way we make meta-templates since wiki markup has several drawbacks. For instance it makes it harder to use [[m:Help:ParserFunctions|parser functions]] and 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.

For more technical details see the [[Template talk:Imbox|talk page]]. Since this template works almost exactly like the other mboxes their talk pages and related pages might also contain more details, see the "See also" section below.

== Ver também ==

{{mbox/ver também}}


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