Manual:$wgExtensionCredits

From MediaWiki.org
Jump to: navigation, search
Extensions: $wgExtensionCredits
Global list of extension credits
Introduced in version: 1.5.0 (r10074)
Removed in version: still in use
Allowed values: See details
Default value: array()

Other settings: Alphabetical | By Function


Contents

[edit] Details

An array of extension types and inside that their names, versions, authors, URLs, descriptions and pointers to localized description messages. Note that the version, url, description and descriptionmsg keys can be omitted.

This credit information gets added to the wiki's Special:Version page, allowing users to see which extensions are installed, and to find more information about them.

This is not a configuration setting mentioned in LocalSettings.php. Typically, extension developers will write code that appends to the array contained in this global variable.

See Manual:Developing extensions#Registering features with MediaWiki

[edit] Usage

Extension developers can append to the array with the following code:

$wgExtensionCredits[$type][] = array(
        'path' => __FILE__,     // File name for the extension itself, required for getting the revision number from SVN - string, adding in 1.15
        'name' => "",           // Name of extension - string
        'description' => "",    // Description of what the extension does - string
        'descriptionmsg' => "", // Same as above but name of a message, for i18n - string, added in 1.12.0
        'version' => 0,         // Version number of extension - number or string
        'author' => "",         // The extension author's name - string or array for multiple
        'url' => "",            // URL of extension (usually instructions) - string
);

The description and author fields get parsed as wiki syntax. This is often used to provide links to the author's homepage in the author field. In version 1.12 and newer, descriptionmsg will override description.

[edit] type

$type must be one of the following:

[edit] descriptionmsg

The value of descriptionmsg will be treated as the name of the message used for the description: see Manual:Developing extensions#Internationalization. As a standard, it's in the form extensionname-desc, or other prefix used for the extension's messages followed by -desc suffix. The description:

  • Must be a single brief sentence: it has no closing period and implies "this extension" as a subject when needed.
  • Is usually in one of the following forms:
    • "Does"/"Adds"/"Allows to do" something (e.g. "Adds <poem> tag for poem formatting");
    • "Allow to do"/"Do" something, with the wiki or the users as subject (e.g. "Hide individual revisions from all users for legal reasons, etc.");
    • "Special page to do" something, or other noun-sentence to describe what the extension is composed of (e.g. "Special page to view global file usage", "Wikimedia specific messages").
  • Includes a link to the (main) added special page(s) if any, using "special page" or "do something" etc. as link labels.
TODO: Clarify guidelines and standardize.

[edit] author

Since r81549 (mw 1.18?), the author list can contain the special hackish '...' to denote other authors. The triple dot will make MediaWiki insert the version-poweredby-others message.

Example:

$wgExtensionCredits['other'][] = array(
 'author' => array( 'Mr Smith', '...' ),
);

[edit] Example

$wgExtensionCredits['specialpage'][] = array(
        'path' => __FILE__,
        'name' => 'Example extension',
        'version' => 1.9,
        'author' => 'Foo Barstein',
        'url' => 'https://www.mediawiki.org/wiki/Extension:MyExtension',
        'descriptionmsg' => 'exampleextension-desc',
);

[edit] See also

Gnome-preferences-other.svg Extensions: Tag Extensions Parser Functions Hooks Special Pages Skins Magic Words API
Language: English  • 日本語