模板:Add alternative text:修订间差异
外观
wiki>Sophivorus 无编辑摘要 |
小 导入1个版本 |
||
(没有差异)
| |||
2025年12月16日 (二) 16:39的最新版本
| 文件:Unofficial JavaScript logo 2.svg | This template is a template gadget. It requires the AddAlternativeText gadget to work, which is loaded automatically when this template is used. |
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:
- 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>
- 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' );
- 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.
| 参数 | 描述 | 类型 | 状态 | |
|---|---|---|---|---|
| Seed | seed 1 | Seed page from where to get the files
| 页面名称 | 必需 |
| Group | group | User group to which to limit the use of the tool
| 字符串 | 可选 |
See also
- Commons:Data:Gadget-AddAlternativeText.tab - Localized messages of the interface
- #AddAlternativeText - All edits done with this tool
- WikitextParser.js - Wikitext parser used by this tool
- es:Plantilla:Agregar texto alternativo - Spanish localization of this template
- User:Sophivorus - Main author of this tool