跳至內容

模組: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}}

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