Extension:関連記事

From mediawiki.org
This page is a translated version of the page Extension:RelatedArticles and the translation is 86% complete.
Outdated translations are marked like this.
MediaWiki 拡張機能マニュアル
RelatedArticles
リリースの状態: 安定
実装 パーサー関数 , API
説明 サイドバーに関連ページへのリンクを追加
作者 Reading Web Team
最新バージョン 3.0.0 (SemVer) (Continuous updates)
MediaWiki 1.25+
PHP 5.4+
データベースの変更 いいえ
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード
CHANGELOG
ヘルプ Help:Extension:RelatedArticles/ja
  • $wgRelatedArticlesDescriptionSource
  • $wgRelatedArticlesFooterAllowedSkins
  • $wgRelatedArticlesOnlyUseCirrusSearch
  • $wgRelatedArticlesCardLimit
  • $wgRelatedArticlesUseCirrusSearchApiUrl
  • $wgRelatedArticlesUseCirrusSearch
Quarterly downloads 69 (Ranked 75th)
translatewiki.net で翻訳を利用できる場合は、RelatedArticles 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告

The RelatedArticles extension adds a parser function to your wikitext that allows associating related articles with your article. It shows related pages as a list of articles and their descriptions at the bottom of a page on desktop and mobile. The extension is also smart enough to get the list of related articles using the morelike feature of CirrusSearch .

ベクタースキン上に表示された関連記事
Minervaスキン上に表示された関連記事

インストール

  • ダウンロードして、ファイルをextensions/フォルダー内のRelatedArticlesという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'RelatedArticles' );
    
  • Yes 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

If you use something other than w/api.php for your API, and related pages is not showing, check for any bad requests in your browser network tab. If necessary, the API used to obtain related articles is configurable with $wgRelatedArticlesUseCirrusSearchApiUrl

追加機能の要件

RelatedArticles can optionally provide additional features if the extensions below are installed:

  • If PageImages is installed, Related Articles will include the page's selected image (if any). Otherwise, a placeholder image will be used instead.
  • If EventLogging is installed, the RelatedPages feature can be configured to log events. See below for configuration manual.
  • Depending on the configuration of $wgRelatedArticlesDescriptionSource, a small description of each page can be fetched. See the configuration manual below for required extensions. Descriptions won't be provided if the specified extension isn't installed.

使用法

Once installed, related articles will be determined algorithmically based on CirrusSearch if available with no additional steps. Alternatively, you can disable this functionality ($wgRelatedArticlesUseCirrusSearch) and manually add related articles like so:

{{#related:Test with read more}}
{{#related:Another test page}}

Configuration

  • Related articles will be shown at the bottom of the skin. Note that the page must be in the Main namespace, and being viewed (as opposed to edited for example), and not be a disambiguation or a diff page, and the skin name (e.g. minerva) that's being used is in the array $wgRelatedArticlesFooterWhitelistedSkins (see below).

The following configuration options apply:

  • If EventLogging is installed, set the event logging sampling rate $wgRelatedArticlesLoggingSamplingRate using a number between 0 and 1. The schema used for logging is RelatedArticles .
  • Use morelike feature of CirrusSearch by setting $wgRelatedArticlesUseCirrusSearch to true. If CirrusSearch is not available fallback to using the related articles marked in wikitext.
  • Use only CirrusSearch's morelike feature by setting $wgRelatedArticlesOnlyUseCirrusSearch to true ignoring the related articles marked in wikitext.
  • $wgRelatedArticlesFooterWhitelistedSkins List of skin names (e.g. 'minerva', 'vector') where related articles will be shown in the footer. For example, on a wiki with Monobook, Vector and Minerva installed$wgRelatedArticlesFooterWhitelistedSkins = ['vector'] will result in the widget showing on Vector only. The skin names have to all be in lowercase, e.g. 'vector' not 'Vector', even if the skin directory is 'Vector'.
  • A small description of the page will be displayed below the title of the page, depending on the value of $wgRelatedArticlesDescriptionSource:

For development

For development the following configuration is recommended:

$wgRelatedArticlesUseCirrusSearchApiUrl = 'https://en.wikipedia.org/w/api.php';
$wgRelatedArticlesUseCirrusSearch = true;
$wgRelatedArticlesFooterAllowedSkins = [ 'vector-2022', 'vector', 'minerva', 'timeless' ];
$wgRelatedArticlesDescriptionSource = 'wikidata';

RelatedPages

The Related Pages feature is implemented in this extension. More info about its development can be found on phabricator.

On Wikimedia Projects

Related pages is enabled on:

  • All Wikipedias, when using Minerva and Timeless skins (except dewiki where they disabled it on Timeless skin), and for hewiki and htwiki, Vector
  • All Wikivoyages, when using Minerva, Timeless and Vector
  • eswikinews, frwikinews and zhwikinews, for all skins

Feedback

Help