Extension:RelatedArticles

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
RelatedArticles

Release status:Extension status stable

ImplementationTemplate:Extension#type Parser function, API
DescriptionTemplate:Extension#description Adds a link to related pages on the sidebar
Author(s)Template:Extension#username Reading Web Team
Latest versionTemplate:Extension#version 3.0.0 (SemVer) (Continuous updates)
MediaWikiTemplate:Extension#mediawiki 1.25+
PHPTemplate:Extension#php 5.4+
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license GNU General Public License 2.0 or later
Download
CHANGELOG
ParametersTemplate:Extension#parameters
  • $wgRelatedArticlesUseCirrusSearch
  • $wgRelatedArticlesOnlyUseCirrusSearch
  • $wgRelatedArticlesLoggingSamplingRate
  • $wgRelatedArticlesFooterBlacklistedSkins
Hooks usedTemplate:Extension#hook
ResourceLoaderTestModulesManual:Hooks/ResourceLoaderTestModules
ParserFirstCallInitManual:Hooks/ParserFirstCallInit
OutputPageParserOutputManual:Hooks/OutputPageParserOutput
GetBetaFeaturePreferencesManual:Hooks/GetBetaFeaturePreferences
MakeGlobalVariablesScriptManual:Hooks/MakeGlobalVariablesScript
BeforePageDisplayManual:Hooks/BeforePageDisplay
EventLoggingRegisterSchemasManual:Hooks/EventLoggingRegisterSchemas
ResourceLoaderGetConfigVarsManual:Hooks/ResourceLoaderGetConfigVars
ResourceLoaderRegisterModulesManual:Hooks/ResourceLoaderRegisterModules

Translate the RelatedArticles extension if it is available at translatewiki.net

Check usage and version matrix.

IssuesPhabricator

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.

Related Articles on the Vector skin.
Related Articles on the Minerva skin.

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}}

Prerequisites[edit]

If EventLogging is installed, the RelatedPages feature can be configured to log events. It is not required.

Installation[edit]

  • Download and place the file(s) in a directory called RelatedArticles in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'RelatedArticles' );
    
  • YesY 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";

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 to `edit`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 $wgRelatedArticlesFooterWhitelistedSkin (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.

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 the Minerva skin of all Wikivoyage projects and Wikipedia projects for example English and Hebrew Wikipedia.

Feedback[edit]

Help[edit]