Extension:SoftRedirector/zh
发行状态: 测试版 |
|
|---|---|
| 实现 | 特殊页面 |
| 描述 | Enables the designation of soft redirect pages with a magic word |
| 作者 | MJL留言 |
| 最新版本 | 0.13 |
| MediaWiki | 1.28+ |
| PHP | 5.4+ |
|
|
| 许可协议 | MIT授權條款 |
| 下載 | |
| 示例 | Special:SoftRedirectPages on MJL Testing Wiki |
| 前往translatewiki.net翻譯SoftRedirector扩展 | |
SoftRedirector is fork of MediaWiki extension Disambiguator that is trying to do for soft redirects what it does for disambiguation pages. It should allow you to designate all soft redirect pages with the __SOFTREDIR__ magic word (or an equivalent alias), which then marks them as such in the database. It is currently unclear if this will allow other extensions to handle soft redirect pages as a separate class of page.
安裝
- 下载文件,并解压
SoftRedirector文件夹到extensions/目录中。
开发者和代码贡献人员应改从Git安装此扩展,输入:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/SoftRedirector
- 請新增下列代码到您的LocalSettings.php文件的底部:
wfLoadExtension( 'SoftRedirector' );
- 按需求配置。
完成 – 請导航至您的wiki上的Special:Version,以验证此扩展已成功安装。
配置
可以从LocalSettings.php文件中设置以下配置变量。
- $wgSoftRedirectorIndicateLinks - whether to add a
'mw-softredir'CSS class to links to soft redirect pages (default istrue)
功能
SoftRedirector provides the following features:
- Programmatic identification of soft redirects pages via the __SOFTREDIR__ magic word
- New special pages for listing all soft redirects and pages linking to soft redirects
- New API functions equivalent to the above special pages as well as an API function for querying whether or not a page is a soft redirect
- Modifies Special:LonelyPages to ignore soft redirects
- Modifies Special:Random to ignore soft redirects (requires MediaWiki 1.26.0)
- If VisualEditor is enabled, allows marking a page as a soft redirect via the page properties interface
- If VisualEditor is enabled, shows whether a page is a soft redirect or not in the link inspector
- If VisualEditor is enabled, shows whether a page is a soft redirect or not in the link dialog
- If configured, add a 'mw-softredir' CSS class to links to soft redirect (See #Configuration below)
用法
On wiki
Once SoftRedirector is installed, the best way to use it is to add the __SOFTREDIR__ magic word to a template that is then included in all of your soft redirect pages.
Once the magic word is in place, your soft redirects will all have the 'soft redirect' page property assigned to them in the database. This property resides in the page_props table.
You will also have two new 特殊页面:
- Special:SoftRedirectPages - which lists all the soft redirect pages on your wiki.
- Special:SoftRedirectPageLinks - which lists all of the pages on your wiki that link to soft redirect pages.
With API
To list all the soft redirects:
api.php?action=query&list=querypage&qppage=softredirectpages
To list all the soft redirect links:
api.php?action=query&list=querypage&qppage=SoftRedirectPageLinks
Note that on wikis running in MiserMode (all WMF wikis), both the special page and API interface for SoftRedirectPageLinks are limited to a certain number of results (typically 1000–5000).
To see if an individual page is a soft redirect page:
api.php?action=query&titles=Bug&prop=pageprops&ppprop=softredirect
If it is a soft redirect page it will include 'softredirect' in its pageprops.
Note that the softredirect pageprop, if present, will have its value set to an empty string, so be careful about testing it as a boolean.
参阅
| 此扩展在以下wiki农场/托管网站和/或软件包中提供: |
- Beta status extensions/zh
- Special page extensions/zh
- AncientPagesQuery extensions/zh
- GetDoubleUnderscoreIDs extensions/zh
- GetLinkColours extensions/zh
- LonelyPagesQuery extensions/zh
- RandomPageQuery extensions/zh
- ShortPagesQuery extensions/zh
- WgQueryPages extensions/zh
- MIT licensed extensions/zh
- Extensions in Wikimedia version control/zh
- All extensions/zh
- Extensions included in Miraheze/zh
- Redirect extensions/zh
