Changes

Jump to navigation Jump to search
Reverted 1 edit by 182.2.170.91 (talk): Unexplained blanking
{{Documentation subpage}}
{{High-risk| 317,000+ }}
<!-- Categories where indicated at the bottom of this page, please; interwikis go to Wikidata (see also: [[Wikipedia:Wikidata]]) -->
{{Uses TemplateStyles|Template:Dmbox/styles.css}}
{{Mbox templates (small)}}

This is the {{tl|Dmbox}} (['''D''']isambiguation footer ['''m''']essage ['''box''']) metatemplate.

It is used to build [[WP:disambiguation|disambiguation]] and [[Wikipedia:set index article|set index article]] message boxes, such as {{tl|Disambiguation}} and {{tl|Ship index}}.

This template works similarly to {{tl|Ambox}} and mostly uses the same parameters. The main differences are that this box uses the disambiguation style and only has two "type" settings.

=== Usage ===
Simple usage example:

<pre>
{{dmbox | text = Some text.}}
</pre>

{{dmbox | text = Some text.}}

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

{{dmbox | type = setindex | text = Some text.}}


Complex example:

<pre>
{{dmbox
| type = setindex
| image = [[File:Schooner.svg|30px|link=|alt=]] [[File:DAB list gray.svg|30px|alt=Disambiguation icon]]
| textstyle=color: red; font-weight: bold; font-style: normal;
| text = The message body text.
}}
</pre>

{{dmbox
| type = setindex
| image = [[File:Schooner.svg|30px|link=|alt=]] [[File:DAB list gray.svg|30px|alt=Disambiguation icon]]
| textstyle=color: red; font-weight: bold; font-style: normal;
| text = The message body text.
}}


Some other parameter combinations:

{{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 = [[File:Schooner.svg|33px|link=|alt=]]
| text = type = setindex <br> imageright = <nowiki>[[File:Schooner.svg|33px|link=|alt=]]</nowiki>
}}

{{dmbox
| type = setindex
| imageright = [[File:Schooner.svg|33px|link=|alt=]]
| text =
This article includes a [[Wikipedia:WikiProject Ships/Guidelines#Index pages|list of ships]] with the same or similar names. If an [[Special:Whatlinkshere/{{NAMESPACE}}:{{PAGENAME}}|internal link]] for a specific ship referred you to this page, you may wish to change the link to point directly to the intended ship article, if one exists.
}}

=== Parameters ===
List of all parameters:

<syntaxhighlight lang="moin">
{{dmbox
| type = disambig / setindex
| image = none / [[File:Some image.svg|40px|link=|alt=]]
| imageright = [[File:Some image.svg|40px|link=|alt=]]
| style=CSS values
| textstyle=CSS values
| text = The message body text.
| nocat = {{{nocat|}}} / true
}}
</syntaxhighlight>

{{Para|type}}
:If no {{Para|type}} parameter is given the template defaults to type {{code|disambig}}.
:{{code|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 "disambigbox". The id is used by the javascript in [[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]].

:{{code|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]].

{{Para|nocat}}
:{{code|true}} = [[Wikipedia:Category suppression|Stops this template from categorizing]]. Useful for tests and demonstrations. Dmbox templates should forward{{when defined as}} {{para|nocat}}, so they too have the option to suppress categories. Thus, it is recommended that Dmbox templates always add something similar to this:
::<code><nowiki>nocat = {{{nocat|}}}</nowiki></code>

{{Para|image}}
:''<span style="color:gray">[No parameter]</span>'' = If no {{Para|image}} parameter is given, the template uses the default {{para|disambig}} or {{para|setindex}} image, depending on the {{Para|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. (Keep the width small; images in this template do not automatically shrink on mobile devices.) For example:
::<code><nowiki>image = [[File:Schooner.svg|30px|link=|alt=]]</nowiki></code>
:<code>none</code> = Means that no image is used.

{{Para|imageright}}
:'''No parameter''' = If no {{Para|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. (Keep the width small; images in this template do not automatically shrink on mobile devices.) For example:
::<code><nowiki>imageright = [[File:Nuvola apps bookcase.png|40px|alt=Books icon]]</nowiki></code>
:'''Anything''' = Any other object that you want to show on the right side.

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

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

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

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

<syntaxhighlight lang="tid">
{{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>
}}
</syntaxhighlight>
{{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>
}}
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.

===See also===
{{Mbox templates see also}}

Other pages:
* [[Wikipedia:Disambiguation]], which includes a section explaining [[Wikipedia:Disambiguation#Set index articles|set index articles]].
* [[Wikipedia:WikiProject Disambiguation]]
* [[MediaWiki:Disambiguationspage]], where all disambiguation message boxes should be listed to assist automatic tools' identification of 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|Disambiguation}}, the generic disambiguation message box.
* {{tl|Set index article}}, the generic set index article message box.

<includeonly>{{Sandbox other|
| <!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Disambiguation message boxes| ]]
[[Category:Set index article templates| ]]
[[Category:Mbox and messagebox templates]]
}}</includeonly>
Anonymous user

Navigation menu