跳转到内容

模板:Add alternative text

来自天灾之下:危险连接资料站
wiki>Sophivorus2025年1月31日 (五) 23:08的版本
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
模板文档

This template inserts a tool for adding alternative text to images.

This tool was originally meant for Wikipedia, but can be used in any wiki. See the installation instructions to get it working in your wiki.

Usage

By category

{{Add alternative text|Category:Extensions supporting Composer}}
Loading...

By template

{{Add alternative text|Template:Extension}}
Loading...

By watchlist

{{Add alternative text|Global templates}}
Loading...

Installation

To install this template in your wiki:

  1. Create a template with the following markup. You can choose the template name, parameter names and defaults to suit your wiki.
    <includeonly><div class="AddAlternativeText" data-seed="{{{seed|{{{1|}}}}}}" data-group="{{{group|}}}">Loading...</div>[[Category:Gadget:AddAlternativeText]]</includeonly>
    
  2. Create MediaWiki:Gadget-AddAlternativeText.js with the following code:
    /**
     * AddAlternativeText is a tool for adding alternative text to files
     * Documentation: https://www.mediawiki.org/wiki/AddAlternativeText
     * Source code: https://www.mediawiki.org/wiki/MediaWiki:Gadget-Global-AddAlternativeText.js
     */
    mw.loader.load( '//www.mediawiki.org/w/load.php?modules=ext.gadget.Global-AddAlternativeText' );
    
  3. Add the following gadget to MediaWiki:Gadgets-definition:
    * AddAlternativeText[ResourceLoader|hidden|default|categories=Gadget:AddAlternativeText]|AddAlternativeText.js
    

Done! Add your template to any page to verify that the installation was successful.

Localization

To help localize the messages of the interface, edit Data:AddAlternativeText.tab.

Template data

This template inserts a tool for adding alternative text to images.

模板参数[编辑模板数据]

此模板首选参数换行的代码块格式。

参数描述类型状态
Seedseed 1

Seed page from where to get the files

示例值
MediaWiki
页面名称必需
Groupgroup

User group to which to limit the use of the tool

示例值
autoconfirmed
字符串可选

See also