Extension:ExtraLanguageLink

The ExtraLanguageLink extension allows you to add additional links to the "Languages" sidebar section on a given page, by way of a parser function/magic word embedded in the page's wikitext.

Usage
{{extralanguagelink:| |class= |style= |title= |lang= |hreflang= }} Only the link target is required: all other parameters are optional. Localised names for the parameters may be available.

$wgExtraLanguageLinkAllowedPrefixes
To restrict the use of this extension to certain interwiki prefixes, set  to an array of allowed interwiki prefixes. Prefixes must be in lowercase only!

The empty string  can be added to the array if you wish to allow extra language links to local pages.

The default value is, meaning that   allows all local and interwiki links.

For example, $wgExtraLanguageLinkAllowedPrefixes = array( 'wikipedia', 'wiktionary', 'c2' ); would allow  but not   or.

$wgExtraLanguageLinkAllowedTitles
Set  to an array of page titles on the wiki where the   parser function is allowed to be used. The default value is, which allows its use on all pages.

Use spaces, not underscores, in this array.

For example: $wgExtraLanguageLinkAllowedTitles = array( 'Main Page', 'Help:Contents' );

Scenarios
Here are some scenarios in which this extension may be useful.

These are Wikimedia-specific examples, but this extension is general in nature, and these examples can be easily adapted to other sites. (Perhaps you might need to add some rows to the interwiki table first.)


 * 1. Adding a "Complete list" link to the language links of a Wikipedia main page
 * In the wiki's configuration, set:

 $wgExtraLanguageLinkAllowedPrefixes = array( 'm' ); $wgExtraLanguageLinkAllowedTitles = array( 'Main Page' ); 
 * On the Main Page, place:


 * 2. Adding a "More languages" link to a Wikisource page
 * Some languages do not have their own version of Wikisource, so texts in those languages are hosted at Multilingual Wikisource. It might be good to add a link across to Multilingual Wikisource from the texts on language-specific domains.
 * In the wiki's configuration, set:
 * $wgExtraLanguageLinkAllowedPrefixes = array( 'oldwikisource' );
 * Create a template, say "Template:Mul-link", with the following content, or similar:
 * Then transclude the template as needed:
 * Then transclude the template as needed: