“Template:Navbox”的版本间的差异

来自汉服百科
跳转至: 导航搜索
(撤销StephDC讨论)的版本2292)
 
(未显示同一用户的5个中间版本)
第1行: 第1行:
<!--
+
<includeonly><!-- 如非必要,請不要修改此模板,因爲此模板具有十分精細的結構。之後的註釋符號均用於縮進和增加空行使結構更加清晰,請不要刪除。
 +
--><!--
  
 
Please do not edit without discussion first as this is a VERY complex template.
 
Please do not edit without discussion first as this is a VERY complex template.
第22行: 第23行:
 
-->{{#if:{{#switch:{{{navbar|}}}|plain|off=1}}<!--
 
-->{{#if:{{#switch:{{{navbar|}}}|plain|off=1}}<!--
 
  -->{{#if:{{{name|}}}||{{#switch:{{{border|{{{1|}}}}}}|subgroup|child|none=1}}}}|<!--
 
  -->{{#if:{{{name|}}}||{{#switch:{{{border|{{{1|}}}}}}|subgroup|child|none=1}}}}|<!--
  -->{{#ifeq:{{{navbar|}}}|off|{{#ifeq:{{{state|}}}|plain|<span style="float:right;width:8em;font-size:80%;">&nbsp;</span>}}|<!--
+
  -->{{#ifeq:{{{navbar|}}}|off|{{#ifeq:{{{state|}}}|plain|<span style="float:right;width:6em;">&nbsp;</span>}}|<!--
  -->{{#ifeq:{{{state|}}}|plain||<span style="float:left;width:8em;font-size:80%;margin-right:0.5em;">&nbsp;</span>}}}}|<!--
+
  -->{{#ifeq:{{{state|}}}|plain||<span style="float:left;width:6em;">&nbsp;</span>}}}}|<!--
 
  -->{{#if:{{{name|}}}|{{Navbar|{{{name}}}|mini=1|<!--
 
  -->{{#if:{{{name|}}}|{{Navbar|{{{name}}}|mini=1|<!--
 
  -->fontstyle={{{basestyle|}}};{{{titlestyle|}}};background:none transparent;border:none;}}|<!--
 
  -->fontstyle={{{basestyle|}}};{{{titlestyle|}}};background:none transparent;border:none;}}|<!--
 
  --><span class="error" style="float:left;white-space:nowrap;">Error: No name provided</span>}}<!--
 
  --><span class="error" style="float:left;white-space:nowrap;">Error: No name provided</span>}}<!--
  -->{{#ifeq:{{{state|}}}|plain|<span style="float:right;width:8em;font-size:80%;">&nbsp;</span>}}}}<!--
+
  -->{{#ifeq:{{{state|}}}|plain|<span style="float:right;width:6em;">&nbsp;</span>}}}}<!--
  
 
  --><div class="{{{titleclass|}}}" style="font-size:110%;">
 
  --><div class="{{{titleclass|}}}" style="font-size:110%;">
第267行: 第268行:
 
{{{list20}}}</div></td></tr>}}<!--
 
{{{list20}}}</div></td></tr>}}<!--
  
-->{{#if:{{{list21|}}}|<!--
 
--><tr style="height:2px"><td></td></tr><tr><!--
 
-->{{#if:{{{group21|}}}|<th scope="row" class="navbox-group {{{groupclass|}}}" <!--
 
-->style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group21style|}}}"><!--
 
-->{{{group21}}}</th><td style="text-align:left;border-left-width:2px;border-left-style:solid;|<td colspan=2 style="}}<!--
 
-->{{#if:{{{groupwidth|}}}||width:100%;}}padding:0px;{{{liststyle|}}};{{{evenstyle|}}};{{{list21style|}}}" <!--
 
-->class="navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}} {{{listclass|}}}"><!--
 
--><div style="padding:{{{listpadding|0em 0.25em}}}">
 
{{{list21}}}</div></td></tr>}}<!--
 
  
-->{{#if:{{{list22|}}}|<!--
+
---Below---
--><tr style="height:2px"><td></td></tr><tr><!--
+
-->{{#if:{{{below|}}}|<!--
-->{{#if:{{{group22|}}}|<th scope="row" class="navbox-group {{{groupclass|}}}" <!--
+
  -->{{#if:{{{title|}}}{{{above|}}}{{{list1|}}}{{{list2|}}}{{{list3|}}}|<tr style="height:2px;"><td></td></tr>}}<!--
  -->style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group22style|}}}"><!--
+
  --><tr><td class="navbox-abovebelow {{{belowclass|}}}" style="{{{basestyle|}}};{{{belowstyle|}}}" <!--
-->{{{group22}}}</th><td style="text-align:left;border-left-width:2px;border-left-style:solid;|<td colspan=2 style="}}<!--
+
  -->colspan="{{#expr:2{{#if:{{{imageleft|}}}|+1}}{{#if:{{{image|}}}|+1}}}}"><div>
  -->{{#if:{{{groupwidth|}}}||width:100%;}}padding:0px;{{{liststyle|}}};{{{evenstyle|}}};{{{list22style|}}}" <!--
+
{{{below}}}</div></td></tr>}}<!--
  -->class="navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}} {{{listclass|}}}"><!--
 
--><div style="padding:{{{listpadding|0em 0.25em}}}">
 
{{{list22}}}</div></td></tr>}}<!--
 
  
-->{{#if:{{{list23|}}}|<!--
 
--><tr style="height:2px"><td></td></tr><tr><!--
 
-->{{#if:{{{group23|}}}|<th scope="row" class="navbox-group {{{groupclass|}}}" <!--
 
-->style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group23style|}}}"><!--
 
-->{{{group23}}}</th><td style="text-align:left;border-left-width:2px;border-left-style:solid;|<td colspan=2 style="}}<!--
 
-->{{#if:{{{groupwidth|}}}||width:100%;}}padding:0px;{{{liststyle|}}};{{{evenstyle|}}};{{{list23style|}}}" <!--
 
-->class="navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}} {{{listclass|}}}"><!--
 
--><div style="padding:{{{listpadding|0em 0.25em}}}">
 
{{{list23}}}</div></td></tr>}}<!--
 
  
-->{{#if:{{{list24|}}}|<!--
+
--></table>{{#switch:{{{border|{{{1|}}}}}}|subgroup|child=<div>|none=|#default=</td></tr></table>}}<!--
--><tr style="height:2px"><td></td></tr><tr><!--
 
-->{{#if:{{{group24|}}}|<th scope="row" class="navbox-group {{{groupclass|}}}" <!--
 
-->style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group24style|}}}"><!--
 
-->{{{group24}}}</th><td style="text-align:left;border-left-width:2px;border-left-style:solid;|<td colspan=2 style="}}<!--
 
-->{{#if:{{{groupwidth|}}}||width:100%;}}padding:0px;{{{liststyle|}}};{{{evenstyle|}}};{{{list24style|}}}" <!--
 
-->class="navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}} {{{listclass|}}}"><!--
 
--><div style="padding:{{{listpadding|0em 0.25em}}}">
 
{{{list24}}}</div></td></tr>}}<!--
 
  
-->{{#if:{{{list25|}}}|<!--
+
-->{{#ifeq:{{NAMESPACE}}|{{ns:10}}|{{#ifeq:{{{border|{{{1|}}}}}}|child||{{#ifeq:{{{border|{{{1|}}}}}}|subgroup||{{#switch:{{lc:{{SUBPAGENAME}}}}
--><tr style="height:2px"><td></td></tr><tr><!--
+
  |doc
-->{{#if:{{{group25|}}}|<th scope="row" class="navbox-group {{{groupclass|}}}" <!--
+
|sandbox
-->style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group25style|}}}"><!--
+
|testcases =
  -->{{{group25}}}</th><td style="text-align:left;border-left-width:2px;border-left-style:solid;|<td colspan=2 style="}}<!--
+
  |#default = {{#switch:{{{bodyclass|}}}
  -->{{#if:{{{groupwidth|}}}||width:100%;}}padding:0px;{{{liststyle|}}};{{{evenstyle|}}};{{{list25style|}}}" <!--
+
  |plainlist
-->class="navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}} {{{listclass|}}}"><!--
+
  |hlist
  --><div style="padding:{{{listpadding|0em 0.25em}}}">
+
  |hlist hnum
{{{list25}}}</div></td></tr>}}<!--
+
  |hlist vcard
 +
  |vcard hlist =
 +
  |#default = {{#switch:{{{listclass|}}}
 +
  |plainlist
 +
  |hlist
 +
  |hlist hnum
 +
  |hlist vcard
 +
  |vcard hlist =
 +
  |#default = {{#ifeq:{{{tracking|}}}|no||[[Category:Navigational boxes without horizontal lists]]}}
 +
  }}
 +
  }}
 +
  }}
 +
}}}}}}<!--
  
-->{{#if:{{{list26|}}}|<!--
+
-->{{#ifeq:{{NAMESPACE}}|{{ns:10}}|{{#switch:{{lc:{{SUBPAGENAME}}}}
--><tr style="height:2px"><td></td></tr><tr><!--
+
|sandbox
-->{{#if:{{{group26|}}}|<th scope="row" class="navbox-group {{{groupclass|}}}" <!--
+
  |testcases =
-->style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group26style|}}}"><!--
+
  |#default = {{#switch:{{{liststyle|}}}
  -->{{{group26}}}</th><td style="text-align:left;border-left-width:2px;border-left-style:solid;|<td colspan=2 style="}}<!--
+
  |padding: 0.25em 0; line-height: 1.3em;
  -->{{#if:{{{groupwidth|}}}||width:100%;}}padding:0px;{{{liststyle|}}};{{{evenstyle|}}};{{{list26style|}}}" <!--
+
  |padding:0.25em 0; line-height:1.4em; width:auto;
-->class="navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}} {{{listclass|}}}"><!--
+
  |padding:0.4em 0; line-height:1.4em; = [[Category:Navigational boxes with custom list spacing]]
  --><div style="padding:{{{listpadding|0em 0.25em}}}">
+
  |#default =
{{{list26}}}</div></td></tr>}}<!--
+
  }}
 +
}}}}</includeonly><noinclude>
 +
'''警告:此模板結構精細,請不要隨意修改。'''
  
-->{{#if:{{{list27|}}}|<!--
+
== 用法實例 ==
  --><tr style="height:2px"><td></td></tr><tr><!--
+
  <nowiki>{{Navbox
  -->{{#if:{{{group27|}}}|<th scope="row" class="navbox-group {{{groupclass|}}}" <!--
+
| name 主题名称
  -->style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group27style|}}}"><!--
+
| state = collapsed
-->{{{group27}}}</th><td style="text-align:left;border-left-width:2px;border-left-style:solid;|<td colspan=2 style="}}<!--
+
| title = [[显示的主题名称]]
-->{{#if:{{{groupwidth|}}}||width:100%;}}padding:0px;{{{liststyle|}}};{{{evenstyle|}}};{{{list27style|}}}" <!--
+
| listclass = hlist
-->class="navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}} {{{listclass|}}}"><!--
 
--><div style="padding:{{{listpadding|0em 0.25em}}}">
 
{{{list27}}}</div></td></tr>}}<!--
 
  
-->{{#if:{{{list28|}}}|<!--
+
| group1 相关话题1
--><tr style="height:2px"><td></td></tr><tr><!--
+
| list1 =  
-->{{#if:{{{group28|}}}|<th scope="row" class="navbox-group {{{groupclass|}}}" <!--
+
* [[话题1的项目1]]
-->style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group28style|}}}"><!--
+
* [[话题1的项目2]]
  -->{{{group28}}}</th><td style="text-align:left;border-left-width:2px;border-left-style:solid;|<td colspan=2 style="}}<!--
 
-->{{#if:{{{groupwidth|}}}||width:100%;}}padding:0px;{{{liststyle|}}};{{{evenstyle|}}};{{{list28style|}}}" <!--
 
-->class="navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}} {{{listclass|}}}"><!--
 
--><div style="padding:{{{listpadding|0em 0.25em}}}">
 
{{{list28}}}</div></td></tr>}}<!--
 
  
-->{{#if:{{{list29|}}}|<!--
+
| group2 相关话题2
--><tr style="height:2px"><td></td></tr><tr><!--
+
| list2 =  
  -->{{#if:{{{group29|}}}|<th scope="row" class="navbox-group {{{groupclass|}}}" <!--
+
* [[话题2的项目1]]
-->style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group29style|}}}"><!--
+
}}</nowiki>
-->{{{group29}}}</th><td style="text-align:left;border-left-width:2px;border-left-style:solid;|<td colspan=2 style="}}<!--
 
-->{{#if:{{{groupwidth|}}}||width:100%;}}padding:0px;{{{liststyle|}}};{{{evenstyle|}}};{{{list29style|}}}" <!--
 
-->class="navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}} {{{listclass|}}}"><!--
 
--><div style="padding:{{{listpadding|0em 0.25em}}}">
 
{{{list29}}}</div></td></tr>}}<!--
 
  
-->{{#if:{{{list30|}}}|<!--
+
  显示效果如下:
  --><tr style="height:2px"><td></td></tr><tr><!--
 
-->{{#if:{{{group30|}}}|<th scope="row" class="navbox-group {{{groupclass|}}}" <!--
 
-->style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group30style|}}}"><!--
 
-->{{{group30}}}</th><td style="text-align:left;border-left-width:2px;border-left-style:solid;|<td colspan=2 style="}}<!--
 
-->{{#if:{{{groupwidth|}}}||width:100%;}}padding:0px;{{{liststyle|}}};{{{evenstyle|}}};{{{list30style|}}}" <!--
 
-->class="navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}} {{{listclass|}}}"><!--
 
--><div style="padding:{{{listpadding|0em 0.25em}}}">
 
{{{list30}}}</div></td></tr>}}<!--
 
  
-->{{#if:{{{list31|}}}|<!--
+
{{Navbox
--><tr style="height:2px"><td></td></tr><tr><!--
+
| name 主题名称
-->{{#if:{{{group31|}}}|<th scope="row" class="navbox-group {{{groupclass|}}}" <!--
+
| state = collapsed
  -->style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group31style|}}}"><!--
+
| title = [[显示的主题名称]]
-->{{{group31}}}</th><td style="text-align:left;border-left-width:2px;border-left-style:solid;|<td colspan=2 style="}}<!--
+
| listclass = hlist
-->{{#if:{{{groupwidth|}}}||width:100%;}}padding:0px;{{{liststyle|}}};{{{evenstyle|}}};{{{list31style|}}}" <!--
 
-->class="navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}} {{{listclass|}}}"><!--
 
--><div style="padding:{{{listpadding|0em 0.25em}}}">
 
{{{list31}}}</div></td></tr>}}<!--
 
 
 
-->{{#if:{{{list32|}}}|<!--
 
--><tr style="height:2px"><td></td></tr><tr><!--
 
-->{{#if:{{{group32|}}}|<th scope="row" class="navbox-group {{{groupclass|}}}" <!--
 
-->style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group32style|}}}"><!--
 
-->{{{group32}}}</th><td style="text-align:left;border-left-width:2px;border-left-style:solid;|<td colspan=2 style="}}<!--
 
-->{{#if:{{{groupwidth|}}}||width:100%;}}padding:0px;{{{liststyle|}}};{{{evenstyle|}}};{{{list32style|}}}" <!--
 
-->class="navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}} {{{listclass|}}}"><!--
 
--><div style="padding:{{{listpadding|0em 0.25em}}}">
 
{{{list32}}}</div></td></tr>}}<!--
 
 
 
-->{{#if:{{{list33|}}}|<!--
 
--><tr style="height:2px"><td></td></tr><tr><!--
 
-->{{#if:{{{group33|}}}|<th scope="row" class="navbox-group {{{groupclass|}}}" <!--
 
-->style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group33style|}}}"><!--
 
-->{{{group33}}}</th><td style="text-align:left;border-left-width:2px;border-left-style:solid;|<td colspan=2 style="}}<!--
 
-->{{#if:{{{groupwidth|}}}||width:100%;}}padding:0px;{{{liststyle|}}};{{{evenstyle|}}};{{{list33style|}}}" <!--
 
-->class="navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}} {{{listclass|}}}"><!--
 
--><div style="padding:{{{listpadding|0em 0.25em}}}">
 
{{{list33}}}</div></td></tr>}}<!--
 
 
 
-->{{#if:{{{list34|}}}|<!--
 
--><tr style="height:2px"><td></td></tr><tr><!--
 
-->{{#if:{{{group34|}}}|<th scope="row" class="navbox-group {{{groupclass|}}}" <!--
 
-->style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group34style|}}}"><!--
 
-->{{{group34}}}</th><td style="text-align:left;border-left-width:2px;border-left-style:solid;|<td colspan=2 style="}}<!--
 
-->{{#if:{{{groupwidth|}}}||width:100%;}}padding:0px;{{{liststyle|}}};{{{evenstyle|}}};{{{list34style|}}}" <!--
 
-->class="navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}} {{{listclass|}}}"><!--
 
--><div style="padding:{{{listpadding|0em 0.25em}}}">
 
{{{list34}}}</div></td></tr>}}<!--
 
 
 
-->{{#if:{{{list35|}}}|<!--
 
--><tr style="height:2px"><td></td></tr><tr><!--
 
-->{{#if:{{{group35|}}}|<th scope="row" class="navbox-group {{{groupclass|}}}" <!--
 
-->style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group35style|}}}"><!--
 
-->{{{group35}}}</th><td style="text-align:left;border-left-width:2px;border-left-style:solid;|<td colspan=2 style="}}<!--
 
-->{{#if:{{{groupwidth|}}}||width:100%;}}padding:0px;{{{liststyle|}}};{{{evenstyle|}}};{{{list35style|}}}" <!--
 
-->class="navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}} {{{listclass|}}}"><!--
 
--><div style="padding:{{{listpadding|0em 0.25em}}}">
 
{{{list35}}}</div></td></tr>}}<!--
 
 
 
 
 
---Below---
 
-->{{#if:{{{below|}}}|<!--
 
-->{{#if:{{{title|}}}{{{above|}}}{{{list1|}}}{{{list2|}}}{{{list3|}}}|<tr style="height:2px;"><td></td></tr>}}<!--
 
--><tr><td class="navbox-abovebelow {{{belowclass|}}}" style="{{{basestyle|}}};{{{belowstyle|}}}" <!--
 
-->colspan="{{#expr:2{{#if:{{{imageleft|}}}|+1}}{{#if:{{{image|}}}|+1}}}}"><div>
 
{{{below}}}</div></td></tr>}}<!--
 
 
 
 
 
--></table>{{#switch:{{{border|{{{1|}}}}}}|subgroup|child=<div>|none=|#default=</td></tr></table>}}<!--
 
  
--><noinclude>
+
| group1 = 相关话题1
 +
| list1 =
 +
* [[话题1的项目1]]
 +
* [[话题1的项目2]]
  
{{documentation}}
+
| group2 = 相关话题2
<!-- 请将分类与跨语言链结增加在/doc子页面 / 請將分類與跨語言連結增加在/doc子頁面 -->
+
| list2 =
</noinclude>
+
* [[话题2的项目1]]
 +
}}

2017年8月11日 (五) 15:31的最新版本

警告:此模板結構精細,請不要隨意修改。

用法實例[编辑]

{{Navbox
| name = 主题名称
| state = collapsed
| title = [[显示的主题名称]]
| listclass = hlist

| group1 = 相关话题1
| list1 = 
* [[话题1的项目1]]
* [[话题1的项目2]]

| group2 = 相关话题2
| list2 = 
* [[话题2的项目1]]
}}

显示效果如下: