Mudanças

Ir para navegação Ir para pesquisar

Predefinição:Dmbox/doc

7 006 bytes adicionados, 10h40min de 21 de dezembro de 2019
Criação da Documentação da Predefinição Dmbox.
{{Subpágina de documentação}}
<!-- POR FAVOR, ADICIONE CATEGORIAS NO FINAL DESTA PÁGINA -->

{{mbox templates}}
Esta é a {{tl|dmbox}}: a metapredefinição '''caixa de mensagem de rodapé para desambiguação'''.

Ela é usada para construir caixas de desambiguação como {{tl|desambiguação}}.

Esta predefinição funciona de forma semelhante a {{tl|ambox}} e a maioria dos parâmetros são os mesmos. As principais diferenças são que esta caixa usa o estilo <code>disambig</code> e só tem duas configurações "tipo".

== Uso ==

Simples exemplo de uso:

<pre>
{{dmbox | text = Algum texto.}}
</pre>

{{dmbox | text = Algum texto.}}

<pre>
{{dmbox | type = setindex | text = Algum texto.}}
</pre>

{{dmbox | type = setindex | text = Algum texto.}}

Exemplo complexo:

<pre>
{{dmbox
| type = setindex
| image = {{nowrap| [[Image:Schooner.svg|30px]] [[Image:List gray.svg|30px]] }}
| textstyle = color: red; font-weight: bold; font-style: normal;
| text = Texto do corpo da mensagem.
}}
</pre>

{{dmbox
| type = setindex
| image = {{nowrap| [[Image:Schooner.svg|30px]] [[Image:List gray.svg|30px]] }}
| textstyle = color: red; font-weight: bold; font-style: normal;
| text = Texto do corpo da mensagem.
}}

Algumas outras combinações de parâmetros:

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

{{dmbox
| type = setindex
| imageright = [[Image:Schooner.svg|33px]]
| text = type = setindex <br /> imageright = <nowiki>[[Image:Schooner.svg|33px]]</nowiki>
}}

{{dmbox
| type = setindex
| imageright = [[Image:Schooner.svg|33px]]
| text =
Este artigo inclui um [[Wikihelp:WikiProject Ships/Guidelines#Índice de páginas|lista de navios]] com alguns nomes iguais ou semelhantes. Se um [[Especial:Whatlinkshere/{{NAMESPACE}}:{{PAGENAME}}|ligação interna]] para um navio específico se refere a esta página, você pode querer mudar o link que aponte diretamente para que se destina o artigo navio, se houver um.
}}

=== Parâmetros ===

Lista de todos os parâmetros:

<pre>
{{dmbox
| type = disambig / setindex
| image = none / [[Image:Some image.svg|40px]]
| imageright = [[Image:Some image.svg|40px]]
| style = CSS values
| textstyle = CSS values
| text = The message body text.
}}
</pre>

'''tipo'''
:If no '''type''' parameter is given the template defaults to type '''disambig'''.
:'''disambig''' = Makes it so the {{tl|disambig editintro}} is displayed when editing a page with this template on. (Means that this template internally sets the CSS id "disambig". The id is used by the javascript in [//en.wikipedia.org/wiki/MediaWiki:Common.js?diff=242169949 en:MediaWiki:Common.js] to determine if a page is a disambiguation page or not.) And adds [[:Category:All disambiguation pages]] and [[:Category:All article disambiguation pages]].

:'''setindex''' = Does ''not'' trigger the {{tl|disambig editintro}} when editing a page. (Because this instead sets the CSS id "setindexbox".) And adds [[:Category:All set index articles]].

<s>'''category'''</s>
:''Don't use this parameter, it is currently broken. I will fix that. --[[User:Davidgothberg|David Göthberg]] ([[User talk:Davidgothberg|talk]]) 21:42, 4 March 2009 (UTC)''

'''image'''
:'''No parameter''' = If no '''image''' parameter is given, the template uses the default disambig or setindex image, depending on the '''type''' parameter.
:'''An image''' = Should be an image with usual wiki notation. 30px - 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:Schooner.svg|30px]]</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. 30px - 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'''
: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.2em;</code>

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

'''text'''
:The message body text. This message box has ''italic'' text as default, thus no need to manually set that.

=== Technical details ===

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 "<code>!important</code>" keyword.)

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

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

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

For more technical details see the [[Template talk:Dmbox|talk page]]. Since this template works almost exactly like {{tl|ambox}}, {{tl|tmbox}}, {{tl|imbox}}, {{tl|cmbox}} and {{tl|ombox}} their talk pages and related pages might also contain more details.

== Ver também ==

{{Mbox/ver também}}

Other pages:

* [[Wikihelp:Disambiguação]] – Also has a section explaining [[Wikihelp:Disambiguação#Set index articles|set index articles]].
* [[Wikihelp:WikiProjeto Disambiguação]]
* [[MediaWiki:Disambiguationspage]] – Should list all disambiguation message boxes, so that some automatic tools can know what pages are disambiguation pages. Now also has a separate list with all set index message boxes, so some tools can know what pages are set index articles.

* {{tl|disambig}} – The generic disambiguation message box.
* {{tl|SIA}} – The generic set index article message box.

<includeonly>
<!-- CATEGORIAS AQUI, OBRIGADO -->
[[Categoria:!Metapredefinições]]
[[Categoria:!Predefinições para desambiguações]]

</includeonly>

Menu de navegação