跳转到内容

Template:Distinguish/doc:修订间差异

轻之舟百科,让知识轻装启航
删除的内容 添加的内容
云云​(留言 | 贡献)
无编辑摘要
云云​(留言 | 贡献)
无编辑摘要
 
第12行: 第12行:
| 3 = 第三个条目名(可选)
| 3 = 第三个条目名(可选)
| 4 = 第四个条目名(可选)
| 4 = 第四个条目名(可选)
| not1 = 排除条目名1(仅 mode=is 时使用)
| not2 = 排除条目名2(仅 mode=is 时使用)
| not3 = 排除条目名3(仅 mode=is 时使用)
| not4 = 排除条目名4(仅 mode=is 时使用)
| type = 事物类型(仅 mode=is 时使用)
| type = 事物类型(仅 mode=is 时使用)
| other = 消歧义页面名(仅 mode=is 时使用)
| other = 消歧义页面名(仅 mode=is 时使用)
第22行: 第26行:
: 显示模式,可选值:<code>not</code>、<code>is</code>、<code>other</code>。不填时默认为 <code>not</code>。
: 显示模式,可选值:<code>not</code>、<code>is</code>、<code>other</code>。不填时默认为 <code>not</code>。
; 1、2、3、4
; 1、2、3、4
: 用于列出消歧义目标条目名。在 <code>mode=not</code> 时表示“主题不是这些”;在 <code>mode=other</code> 时仅 <code>1</code> 生效,表示消歧义页面。
: 用于列出消歧义目标条目名。在 <code>mode=not</code> 时表示“主题不是这些”;在 <code>mode=other</code> 时仅 <code>1</code> 生效,表示消歧义页面;在 <code>mode=is</code> 时 <code>1</code> 表示主题名称。
; not1、not2、not3、not4
: 仅在 <code>mode=is</code> 时使用,用于列出“主题不是”的排除条目,可指定最多 4 个。
; type
; type
: 仅在 <code>mode=is</code> 时使用,用于描述主题的类别,如“水果”“公司”“电影”等。不填时默认为“事物”。
: 仅在 <code>mode=is</code> 时使用,用于描述主题的类别,如“事物”“词语”“公司”“电影”等。不填时默认为“事物”。
; other
; other
: 仅在 <code>mode=is</code> 时使用,指定“其它用法请见”的消歧义页面名。
: 仅在 <code>mode=is</code> 时使用,指定“其它用法请见”的消歧义页面名。
第33行: 第39行:


=== mode=not(默认) ===
=== mode=not(默认) ===
<pre>{{Distinguish|mode=not|1=Apple Inc|2=iPhone}}</pre>
<pre>{{Distinguish|mode=not|1=虚舟实验室|2=虚舟号}}</pre>
效果:
{{Distinguish|mode=not|1=虚舟实验室|2=虚舟号}}


=== mode=is(带排除列表) ===
<pre>{{Distinguish
| mode = is
| 1 = 虚舟
| type = 词语
| not1 = 虚舟实验室
| other = 虚舟 (消歧义)
}}</pre>
效果:
{{Distinguish
| mode = is
| 1 = 虚舟
| type = 词语
| not1 = 虚舟实验室
| other = 虚舟 (消歧义)
}}


=== mode=is ===
=== mode=is(无排除列表) ===
<pre>{{Distinguish|mode=is|1=苹果|type=水果|other=苹果 (消歧义)}}</pre>
<pre>{{Distinguish
| mode = is

| 1 = 虚舟
| type = 词语
| other = 虚舟 (消歧义)
}}</pre>
效果:
{{Distinguish
| mode = is
| 1 = 虚舟
| type = 词语
| other = 虚舟 (消歧义)
}}


=== mode=other ===
=== mode=other ===
<pre>{{Distinguish|mode=other|1=苹果 (消歧义)}}</pre>
<pre>{{Distinguish|mode=other|1=虚舟 (消歧义)}}</pre>
效果:

{{Distinguish|mode=other|1=虚舟 (消歧义)}}



=== 使用 text 自定义 ===
<pre>{{Distinguish|text=本条目的主题是“虚舟”一词,关于其他含义请见 [[虚舟 (消歧义)]]。}}</pre>
效果:
{{Distinguish|text=本条目的主题是“虚舟”一词,关于其他含义请见 [[虚舟 (消歧义)]]。}}


== 注意事项 ==
== 注意事项 ==


* 本模板依赖 <code>Template:If mobile</code> 实现移动端适配。如果站点没有该模板,请删除代码中的 <code>{{If mobile|2=&nbsp;&nbsp;}}</code> 部分。
* 本模板依赖 <code>Template:If mobile</code> 实现移动端适配。如果站点没有该模板,请删除模板代码中的 <code>{{If mobile|2=&nbsp;&nbsp;}}</code> 部分。
* 建议在条目顶部、序言之前使用本模板。
* 建议在条目顶部、序言之前使用本模板。
* 消歧义页面命名请遵循站点的命名规范,通常为“<nowiki>主条目名 (消歧义)</nowiki>”。
* 消歧义页面命名请遵循站点的命名规范,通常为“<nowiki>主条目名 (消歧义)</nowiki>”。
* <code>not1</code>~<code>not4</code> 仅在 <code>mode=is</code> 下生效,其他模式会被忽略。


== 参见 ==
== 参见 ==


* [[Template:Other uses]]
* [[Template:Distinguish]](本模板)
* [[Template:Distinguish]](本模板)
* [[Template:For]]
* [[Template:For]]

2026年8月26日 (三) 11:21的最新版本

本模板用于在条目顶部显示消歧义提示,支持多种模式灵活调用。

{{Distinguish
| mode    = 模式名称
| 1       = 第一个条目名
| 2       = 第二个条目名(可选)
| 3       = 第三个条目名(可选)
| 4       = 第四个条目名(可选)
| not1    = 排除条目名1(仅 mode=is 时使用)
| not2    = 排除条目名2(仅 mode=is 时使用)
| not3    = 排除条目名3(仅 mode=is 时使用)
| not4    = 排除条目名4(仅 mode=is 时使用)
| type    = 事物类型(仅 mode=is 时使用)
| other   = 消歧义页面名(仅 mode=is 时使用)
| text    = 自定义提示文本(可选,会覆盖默认生成的内容)
}}

参数说明

[编辑源代码]
mode
显示模式,可选值:not、is、other。不填时默认为 not。
1、2、3、4
用于列出消歧义目标条目名。在 mode=not 时表示“主题不是这些”;在 mode=other 时仅 1 生效,表示消歧义页面;在 mode=is 时 1 表示主题名称。
not1、not2、not3、not4
仅在 mode=is 时使用,用于列出“主题不是”的排除条目,可指定最多 4 个。
type
仅在 mode=is 时使用,用于描述主题的类别,如“事物”“词语”“公司”“电影”等。不填时默认为“事物”。
other
仅在 mode=is 时使用,指定“其它用法请见”的消歧义页面名。
text
完全自定义提示文本,填写后将忽略上述所有参数生成的默认内容。

mode=not(默认)

[编辑源代码]
{{Distinguish|mode=not|1=虚舟实验室|2=虚舟号}}

效果:

mode=is(带排除列表)

[编辑源代码]
{{Distinguish
| mode = is
| 1 = 虚舟
| type = 词语
| not1 = 虚舟实验室
| other = 虚舟 (消歧义)
}}

效果:

mode=is(无排除列表)

[编辑源代码]
{{Distinguish
| mode = is
| 1 = 虚舟
| type = 词语
| other = 虚舟 (消歧义)
}}

效果:

mode=other

[编辑源代码]
{{Distinguish|mode=other|1=虚舟 (消歧义)}}

效果:

使用 text 自定义

[编辑源代码]
{{Distinguish|text=本条目的主题是“虚舟”一词,关于其他含义请见 [[虚舟 (消歧义)]]。}}

效果:

注意事项

[编辑源代码]
  • 本模板依赖 Template:If mobile 实现移动端适配。如果站点没有该模板,请删除模板代码中的    部分。
  • 建议在条目顶部、序言之前使用本模板。
  • 消歧义页面命名请遵循站点的命名规范,通常为“主条目名 (消歧义)”。
  • not1~not4 仅在 mode=is 下生效,其他模式会被忽略。