Template:Dmbox/doc and Template:Fix: Difference between pages

From ZeldaMods (Breath of the Wild)
< Template:Dmbox(Difference between pages)
Jump to navigation Jump to search
imported>Leoetlino
m (1 revision imported)
 
imported>Leoetlino
m (1 revision imported)
 
Line 1: Line 1:
{{Documentation subpage}}
{{#switch:{{{subst|¬}}}
{{High-risk| 317,000+ }}
|¬={{category handler
<!-- Categories where indicated at the bottom of this page, please; interwikis go to Wikidata (see also: [[Wikipedia:Wikidata]]) -->
  |template=[[Category:Templates needing substitution checking]]
{{Mbox templates (small)}}
  |nocat={{{nocat|<noinclude>true</noinclude>}}}
 
}}
This is the {{tl|Dmbox}} (['''D''']isambiguation footer ['''m''']essage ['''box''']) metatemplate.
|SUBST=[[Category:Pages with incorrectly substituted templates]]
 
}}{{Category handler
It is used to build [[WP:disambiguation|disambiguation]] and [[Wikipedia:set index article|set index article]] message boxes, such as {{tl|Disambiguation}} and {{tl|Shipindex}}.
|main={{Fix/category
 
  |cat-date={{{cat-date|}}}  
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.
  |cat={{{cat|}}}  
 
  |cat-date2={{{cat-date2|}}}  
=== Usage ===
  |cat2={{{cat2|}}}  
Simple usage example:
  |cat-date3={{{cat-date3|}}}  
 
  |cat3={{{cat3|}}}  
<pre>
  |date={{{date|}}}
{{dmbox | text = Some text.}}
}}
</pre>
|template={{#if:{{{name|}}}|{{#ifeq:{{{name}}}|{{ROOTPAGENAME}}||{{#if:{{{date|}}}||[[Category:Templates including undated clean-up tags]]}}}}}}
 
|subpage=no
{{dmbox | text = Some text.}}
}}{{#if:{{{text|}}}
 
|<sup class="noprint Inline-Template {{{class|}}}" style="white-space:nowrap;">&#91;<i>{{#if:{{{pre-text|}}}
<pre>
  |{{{pre-text}}}&#32;
{{dmbox | type = setindex | text = Some text.}}
}}[[{{{link|Wikipedia:Cleanup}}}|<span title="{{delink|1={{{title|{{{link|Wikipedia:Cleanup}}}}}}{{#if:{{{date|}}}|&#32;({{{date}}})}}}}">{{{text|}}}</span>]]{{#if:{{{post-text|}}}
</pre>
  |&#32;{{{post-text}}}
 
}}</i>&#93;</sup>|{{{special|}}}
{{dmbox | type = setindex | text = Some text.}}
}}<noinclude>
 
{{Documentation}}
 
<!-- Add cats and interwikis to the /doc subpage, not here! -->
Complex example:
</noinclude>
 
<pre>
{{dmbox
| type      = setindex
| image    = {{nowrap| [[Image:Schooner.svg|30px]] [[Image:DAB list gray.svg|30px]] }}
| textstyle=color: red; font-weight: bold; font-style: normal;
| text      = The message body text.
}}
</pre>
 
{{dmbox
| type      = setindex
| image    = {{nowrap| [[Image:Schooner.svg|30px]] [[Image:DAB list gray.svg|30px]] }}
| 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 = [[Image:Schooner.svg|33px]]
| text  = type = setindex <br> imageright = <nowiki>[[Image:Schooner.svg|33px]]</nowiki>
}}
 
{{dmbox
| type = setindex
| imageright = [[Image:Schooner.svg|33px]]
| 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:
 
<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.
| nocat = {{{nocat|}}} / true
}}
</pre>
 
{{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. (But the message box can handle images of any size.) For example:
::<code><nowiki>image = [[Image:Schooner.svg|30px]]</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. (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.
 
{{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 ===
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.
 
===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>{{#ifeq:{{SUBPAGENAME}}|sandbox |
| <!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Disambiguation message boxes| ]]
[[Category:Set index article templates| ]]
[[Category:Mbox and messagebox templates]]
}}</includeonly>

Latest revision as of 09:37, 3 September 2018

Template documentation[create]