跳至內容

模組:Commons link/doc

本頁使用了標題或全文手工轉換
維基百科,自由的百科全書

此頁面為 Module:Commons link 的說明文件

如要測試沙盒,請見Module:Commons link/sandbox/testcases

用法[編輯]

{{#invoke:Commons link|getGallery}}

使用維基數據以找到對應此文章的Commons圖庫。如果未能在維基數據中找到圖庫,則默認為在Commons中搜索頁面名稱。

{{#invoke:Commons link|getGallery|title|linktext=text}}

鏈接至位於title的Commons圖庫,可以使用text作為顯示的鏈接文本。

{{#invoke:Commons link|getGallery|search=string|linktext=text}}

鏈接至Commons搜索string,可以使用text作為顯示的鏈接文本。

{{#invoke:Commons link|getCategory|fallback=string|linktext=text}}

先使用維基數據,如果失敗,使用Commons搜索string,可以使用text作為顯示的鏈接文本。

{{#invoke:Commons link|getCategory}}

使用維基數據尋找對應此文章的Commons分類,如果沒有在維基數據中找到分類,則默認為在Commons的搜索Category:PAGENAME。

{{#invoke:Commons link|getCategory|title|linktext=text}}

鏈接至Commons的分類Category:title,可以使用text作為顯示的鏈接文本。

{{#invoke:Commons link|getCategory|search=string|linktext=text}}

鏈接至Commons搜索Category:string,可以使用text作為顯示的鏈接文本。

{{#invoke:Commons link|getCategory|fallback=string|linktext=text}}

先使用維基數據,如果失敗,使用Commons搜索Category:string,可以使用text作為顯示的鏈接文本。

{{#invoke:Commons link|getGalleryOrCategory}}

使用維基數據找到「最好」的一個Commons鏈接:先嘗試圖庫,然後再找分類。其他參數如上所示。

{{#invoke:Commons link|getGalleryAndCategory}}

Lua以實現{{commons and category}}:返回Commons圖庫、Commons分類,或者兩者(如果都找到了)。

{{#invoke:Commons link|getGalleryAndCategory|GalleryName|CategoryName}}

GalleryName和CategoryName或者兩者都可以提供,會覆蓋維基數據的搜索。

{{#invoke:Commons link|bold=1|italic=1|nowrap=1|lcfirst=1}}

可以指定第一個鏈接的格式。

{{#invoke:Commons link|linktext=link|categoryText=category}}

第一個鏈接的文字,第二個(分類)鏈接也可以被覆蓋。

{{#invoke:Commons link|tracking=1}}

模塊在沒有找到有關提供的參數和維基數據時,可以產生追蹤分類。