模板:Template display/doc

維基百科,自由的百科全書
跳至導覽 跳至搜尋

-->

維基百科的桌面瀏覽界面和手機瀏覽界面有很大的不同,有時模板只適用於特定的界面。 由於這個原因,某些模板不能在移動視圖中顯示,可使用class = "nomobile"標記。

截至2017年3月,只有"nomobile"類被實現,而"nodesktop"/"mobileonly"類已失效,因為它們沒有在MediaWiki:Common.cssMediaWiki:Mobile.css實現——這意味着只有{{Template display|nomobile}}{{Template display|desktoponly}}有效。

這個模板本身並不能控制內容的顯示。它只用於模板文檔中說另一個模板的顯示位置。

用途[編輯]

自適應模板[編輯]

{{Template display|adaptive}}

只在桌面顯示的模板[編輯]

{{Template display|nomobile}}

只在移動端顯示的模板[編輯]

{{Template display|nodesktop}}

不能在Vector 2022皮膚上正確工作的模板[編輯]

{{Template display|vector2022}}

模板參數[編輯]

以下是該模板的模板資料,適用於視覺化編輯器等工具。

Template display模板資料

<templatedata> { "params": { "1": { "label": "適用的視圖", "description": "填寫該模板所適用的視圖\n\"adaptive\":自適應視圖\n\"nomobile\":只適用桌面版\n\"nodesktop\":只適用移動版\n\"vector2022\":不適合vector2022皮膚",

           "example": "adaptive",

"type": "string",

           "required": true

} }, "description": "用來說明該模板適用哪一個視圖", "format": "inline" } </templatedata>

所用圖像[編輯]

參見[編輯]