今天是2024年8月23日 第34周 星期五
代人,时大变了。
我们生活在大地上,但我们的梦想超越天空。
模板:Dmbox/doc
![]() | 此页面是Template:Dmbox的Templatedocumentation。 此页面可能包含了模板的使用说明、分类和其他内容。 |
![]() | 此Templatedocumentation被引用于约40,000个页面中。 为了避免造成大规模的影响,所有对此Templatedocumentation的编辑应先于沙盒、测试样例或您的使用者页面上测试。 测试后无误的版本可以一次性地加入此Templatedocumentation中,但是修改前请务必于讨论页发起讨论。 |
此为 {{dmbox}} 或 消歧义页脚讯息框 元模板。
本模板用以建立消歧义及设置索引条目讯息框,像是 {{disambig}} 和 {{shipindex}}。
本模板运作方式类似 {{ambox}} 且大部分使用了相同的参数。主要差异在于本讯息框用在消歧义风格,并只有2种 "type" 设定选项。
用法
简单用法示例:
{{dmbox | text = Some text.}}
![]() |
Some text. |
{{dmbox | type = setindex | text = Some text.}}
30px | Some text. |
复杂用法示例:
{{dmbox | type = setindex | image = {{nowrap| [[File:Schooner.svg|30px]] [[File:List gray.svg|30px]] }} | textstyle = color: red; font-weight: bold; font-style: normal; | text = The message body text. }}
30px 30px | The message body text. |
其他一些参数组合:
![]() |
No type and no image given (default) |
No type and image=none – No image is used and the text uses the whole message box area. |
30px | type = setindex imageright = [[File:Schooner.svg|33px]] |
33px |
30px | This article includes a list of ships with the same or similar names. If an 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. | 33px |
参数
所有的参数清单:
{{dmbox | type = disambig / setindex | image = none / [[File:Some image.svg|40px]] | imageright = [[File:Some image.svg|40px]] | style = CSS values | textstyle = CSS values | text = The message body text. }}
type
- If no type parameter is given the template defaults to type disambig.
- disambig = Makes it so the {{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 MediaWiki:Common.js to determine if a page is a disambiguation page or not.) And adds Category:全部消歧义页面 and Category:全部主条目消歧义页面.
- setindex = Does not trigger the {{disambig editintro}} when editing a page. (Because this instead sets the CSS id "setindexbox".) And adds Category:全部设置索引条目.
category
- Don't use this parameter, it is currently broken. I will fix that. --David Göthberg (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:
image = [[File:Schooner.svg|30px]]
- 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:
imageright = [[File:Nuvola apps bookcase.png|40px]]
- Anything = Any other object that you want to show on the right side.
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.2em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text. This message box has italic text as default, thus no need to manually set that.
技术细节
该模板当前使用硬编码的样式和类名称。以后,它将仅使用CSS类,使皮肤更容易使用。 (与此同时,可以使用“ !important </ code>”关键字对它进行外观设置。)
如果需要在text参数中使用特殊字符,则需要像这样转义它们:
{{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 }}.
And now a pipe and end braces |}}.
</div>
}}
![Disambig gray.svg](/images/thumb/5/5f/Disambig_gray.svg/30px-Disambig_gray.svg.png)
Equal sign = and a start and end brace { } work fine as they are.
But here is a pipe | and two end braces }}.
And now a pipe and end braces |}}.
在内部,此元模板使用HTML标记而不是表代码的Wiki标记。这是我们制作元模板的常用方法,因为Wiki标记有几个缺点。例如,它使在参数中使用解析器函数和特殊字符变得更加困难。
有关更多技术细节,请参见 讨论页面。由于此模板的工作原理几乎与{{ ambox}},{{ tmbox}},{{ imbox}},{{ cmbox}}和{{ ombox}}的讨论页一样,相关页面也可能包含更多详细信息。
参见
在讯息框(mbox)家族中的元模板:
有相近关系的元模板:
其他页面:
- Wikipedia:消歧义 – Also has a section explaining set index articles.
- Wikipedia:WikiProject Disambiguation
- 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.