Extension:RelatedArticles
![]() | This extension is maintained by the Web team. |
![]() Release status: stable |
|
---|---|
Implementation | Parser function , API |
Description | Adds a link to related pages on the sidebar |
Author(s) | Reading Web Team |
Latest version | 3.0.0 (SemVer) (Continuous updates) |
MediaWiki | 1.25+ |
PHP | 5.4+ |
Database changes | No |
License | GNU General Public License 2.0 or later |
Download | CHANGELOG |
Help | Help:Extension:RelatedArticles |
|
|
Quarterly downloads | 114 (Ranked 85th) |
Translate the RelatedArticles extension if it is available at translatewiki.net | |
Issues | Open tasks · Report a bug |
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.


Installation[edit]
- Download and place the file(s) in a directory called
RelatedArticles
in yourextensions/
folder. - Add the following code at the bottom of your
LocalSettings.php
:wfLoadExtension( 'RelatedArticles' );
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
To users running MediaWiki 1.24 or earlier:
The instructions above describe the new way of installing this extension using wfLoadExtension()
.
If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'RelatedArticles' );
, you need to use:
require_once "$IP/extensions/RelatedArticles/RelatedArticles.php";
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
Requirements for additional features[edit]
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.
Usage[edit]
Once installed, related articles will be determined algorithmically based on Cirrus Search 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[edit]
- Related articles will be shown at the bottom of the skin. Note that the page must be in the Main namespace, and being
view
ed (as opposed toedit
ed 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
totrue
. If CirrusSearch is not available fallback to using the related articles marked in wikitext. - Use only CirrusSearch's morelike feature by setting
$wgRelatedArticlesOnlyUseCirrusSearch
totrue
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
:wikidata
: Requires Wikibase Client, from the central wikibase repository or Extension:ShortDescription.textextracts
: Requires Extension:TextExtracts, fetched from the prop=extracts api.pagedescription
: Requires Extension:Description2 (or any other extension that sets thedescription
page property).
RelatedPages[edit]
The Related Pages feature is implemented in this extension. More info about its development can be found on phabricator.
On Wikimedia Projects[edit]
Related pages is enabled on:
- All Wikipedias and frwikinews, 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 and zhwikinews, for all skins
Feedback[edit]
- Create a task in Wikimedia's issue tracker under the "RelatedArticles" project.
- Check the list of existing RelatedArticles tasks
Help[edit]
![]() | This extension is being used on one or more Wikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page. |
![]() | This extension is included in the following packages and/or wiki farms: This is not an authoritative list. Some wiki farms/hosts may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |
- Stable extensions
- Parser function extensions
- API extensions
- GPL licensed extensions
- Extensions in Wikimedia version control
- BeforePageDisplay extensions
- MakeGlobalVariablesScript extensions
- OutputPageParserOutput extensions
- ParserFirstCallInit extensions
- ResourceLoaderGetConfigVars extensions
- SkinAfterContent extensions
- All extensions
- Extensions used on Wikimedia
- Extensions included in Miraheze
- Extensions included in MyWikis
- Extensions included in ProWiki
- Extensions included in WikiForge