模板:Navbox with collapsible groups/sandbox

文件圖示 模板文件[檢視] [編輯] [歷史] [清除快取]


本模板產生的導航模板含有許多個group。所有組別下的文章都是關於同一個主題的。所有group在默認狀態下都是隱藏的,但是通過呼叫一個參數(點擊右上角的「顯示」),一個單獨的group可以被展開。

用法 編輯

模板當前支持10個groups/lists,但如果需要,可以加入更多的group。你至少應該使用2個groups/lists,否則請使用{{Navbox}}。

{{Navbox with collapsible groups
|name = {{subst:PAGENAME}}
|state = 
|selected = {{{1|}}}

|title = 
|titlestyle = 
|groupstyle = 
|image = 

|group1 = 
|abbr1 = 
|list1 =

|group2 = 
|abbr2 = 
|list2 = 

 ...

|group10 = 
|abbr10 = 
|list10 = 
}}

參數 編輯

本模板和它的姐妹模板{{Navbox}}、{{Navbox with columns}}使用許多通用的參數。通用參數用一個十字符號標明。要深入了解這些參數的詳細介紹和實例,請參見{{Navbox}}。

屬性參數 編輯

name
模板名。比如模板的名字可以是「Navbox with collapsible groups。」
state [autocollapse, uncollapsed, collapsed, plain, off]
主標題顯示/隱藏的初始狀態。更多信息請查看{{Navbox}}。這不影響其下各group的顯示或隱藏狀態,參加下面的staten
navbar
可取的值為plainoff,以及默認的留空。更多信息請查看{{Navbox}}。
border
可取的值為childnone,以及默認的留空。如果你希望將一個導航框(navbox)置於另一個navbox之內,則設為child;選擇這個值時,子navbox將緊貼在父navbox內,沒有邊框。父navbox可以是{{Navbox}}的list區,也可以是{{Navbox with columns}}的一個欄(column),{{Navbox with collapsible groups}}的list區。更多信息和範例請查看{{Navbox}}。

基本數據參數 編輯

title
模板的標題,在頂端的標題欄居中顯示。
above
在groups/lists上方顯示的文字或者其他元素。
image
在所有groups/lists右邊顯示的圖片。
imageleft
在所有groups/lists左邊顯示的圖片。
below
在groups/lists下方顯示的文字或者其他元素。

groups/lists參數 編輯

groupn
每部分的標題。
listn
在group中顯示的內容/維基連結。用 . (dot)或者 · ({{·}},bullet)作為分隔符(見參見)。可以選擇將一個{{Navbox}}或者{{Navbox with columns}}置於此處,要用到它的border = child參數。如果已經這樣做,請將對應的group n 留空,因為它的子navbox已經提供了收起(collapsible)功能。
abbrn
這是group的縮寫。參見下面的參數以了解如何使用。selected參數是可選的,但建議使用。
selected
如果selected的值與 abbrn 的值相同,則第 n list是展開的,而所有其他list是收起的。如果將selected留空,或者它不與任何 abbrn 想匹配,則所有group都是收起的。一般將這個參數設為{{{1|}}}。Since this template is a base template for others, there has to be a way to pass the group parameter from the article, to the secondary template to this one.
staten [autocollapse, uncollapsed, collapsed, plain, off]
listn 展開/收起的初始狀態。默認狀態為收起。如果selectedabbrn 相同,則改為展開。
imagen
出現在listn 內容區右邊的一個圖片。
imageleftn
出現在listn 內容區左邊的一個圖片。

樣式參數 編輯

bodystyle
應用於整個模板的CSS樣式
titlestyle
應用於標題欄的CSS樣式;一般設為background:color。維基連結文字的顏色必須使用span標籤手動調整。例如使用title = [[Scouting|<span style="color:ivory;">Scouting</span>]]將連結的顏色改為改變ivory。「顯示」/「隱藏」按鍵和「查」「論」「編」連結按鍵使用標題樣式參數中設定的顏色。這裏是一個設置標題樣式的範例:
titlestyle = background:darkgreen;color:ivory;
abovestyle
belowstyle
分別應用於above and below參數的CSS樣式。
basestyle
同時應用於titleabovebelowgroupn的CSS樣式。
imagestyle
應用於image參數的CSS樣式。不適用於 imagen 參數。
imageleftstyle
應用於imageleft參數的CSS樣式。不適用於 imageleftn 參數。
groupstyle
應用於所有group頭部參數的CSS樣式。訪問this website以獲得與頭部背景色相似的明亮顏色。範例:
groupstyle = background:lightgreen;
groupnstyle
應用於特定group頭部的CSS樣式;能改變在groupstyle中已經設定過的任何CSS樣式。
liststyle
應用於所有list內容參數的CSS樣式。
listnstyle
應用於特定list內容的CSS樣式;能改變在liststyle中已經設定過的任何CSS樣式。
listpadding
每個list單元格的邊距;默認狀態下,左右為0.25em,上下為0em。

範例 編輯

{{Navbox with collapsible groups
|name = University of Michigan
|title = [[University of Michigan|<span style="color:#FFD700;">The University of Michigan, Ann Arbor</span>]]
|titlestyle = background:#00008B;color:#FFD700;
|groupstyle = background:#FFD700;color:#00008B;
|image = 
|selected = {{{1|}}}
|state = collapsed

|group1 = [[University of Michigan#Academic profile|<span style="color:#00008B;">Academics</span>]]
|abbr1 = academics
|list1 = [[University of Michigan College of Engineering|College of Engineering]]{{·}} [[University of Michigan College of Literature, Science, and the Arts|College of Literature, Science and the Arts]]{{·}} [[Gerald R. Ford School of Public Policy]]{{·}} [[University of Michigan Law School|Law School]]{{·}} [[University of Michigan Health System|Medical School]]{{·}} [[Ross School of Business]]{{·}} [[University of Michigan School of Education|School of Education]]{{·}} [[University of Michigan School of Information|School of Information]]{{·}} [[University of Michigan School of Music, Theatre & Dance|School of Music, Theatre & Dance]]{{·}}[[University of Michigan School of Natural Resources and Environment|School of Natural Resources and Environment]]{{·}} [[University of Michigan School of Public Health|School of Public Health]]{{·}} [[Taubman College of Architecture and Urban Planning]]

|group2 = [[Michigan Wolverines|<span style="color:#00008B;">Athletics</span>]]
|abbr2 = athletics
|list2 = [[Michigan Stadium|Michigan Stadium]]{{·}} [[Crisler Arena|Crisler Arena]]{{·}} [[Yost Ice Arena|Yost Ice Arena]]{{·}} [[Michigan Wolverines|Michigan Wolverines]]{{·}} [[Michigan Wolverines football|Football]]{{·}} [[Michigan-Ohio State rivalry|UM-OSU Rivalry]]{{·}} [[Little Brown Jug (football)|Little Brown Jug]]{{·}} [[Paul Bunyan Trophy]]{{·}} [[Cold War (ice hockey)|Cold War]]

|group3 = Campus
|abbr3 = campus
|list3 = [[Angell Hall Observatory]]{{·}} [[Burton Tower]]{{·}} [[The Diag]]{{·}} [[David M. Dennison Building|Dennison Building]]{{·}} [[Gerald R. Ford Presidential Library]]{{·}} [[Hill Auditorium|Hill Auditorium]]{{·}} [[Lurie Tower]]{{·}} [[Matthaei Botanical Gardens]]{{·}} [[Michigan Union]]{{·}} [[Museums at the University of Michigan|Museums]]{{·}} [[Nichols Arboretum]]{{·}} [[University of Michigan Health System|UM Health System]]{{·}} [[University of Michigan Library|University Library]]

}}

參見 編輯

導航模板比較
可摺疊? 標題顏色 圖像 組別 樣式(主體)
參數
範例
{{Navbox}} navbox 主體左/右側 {{H:f Help}}
{{Navbox with columns}} navbox 欄左/右側 {{APEC}}
{{NavboxYears}} navbox
{{Navbox with collapsible groups}} navbox 主體左/右側 及/或 在每列表中 {{ATI}}
摺疊屬性
類別 CSS class Javascript 何時摺疊 自定義
初始狀態
套疊結構
Collapsible tables collapsible Common.js定義 頁面有兩塊或以上autocollapse模板