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

模块在没有找到有关提供的参数和维基数据时,可以产生追踪分类。