MediaWiki-Docker/Extension/ContactPage

This page instructs you to install Extension:ContactPage inside MediaWiki-Docker .

Follow the Quickstart instructions at MediaWiki-Docker page. Once MediaWiki is running and available at http://localhost:8080, then continue with instructions on this page.

All commands should be run in the directory where you installed MediaWiki. All mentioned files are also located there.

Clone the repository and its dependencies

git clone "https://gerrit.wikimedia.org/r/mediawiki/extensions/ContactPage" extensions/ContactPage
git clone "https://gerrit.wikimedia.org/r/mediawiki/skins/Vector" skins/Vector

Install Composer dependencies

Add this to composer.local.json:

{
	"extra": {
		"merge-plugin": {
			"include": [
				"extensions/ContactPage/composer.json"
			]
		}
	}
}

Alternatively copy

mv composer.local.json-sample composer.local.json

As this will include all extensions' composer.json files by default.

Run:

docker compose exec mediawiki composer update

Modify LocalSettings.php

If not already there, add this to the end of LocalSettings.php.

wfLoadExtension( 'ContactPage' );
wfLoadSkin( 'Vector' );
$wgContactConfig['default'] = [
	'RecipientUser' => 'WikiUser', // Must be the name of a valid account which also has a verified e-mail-address added to it.
	'SenderName' => 'Contact Form on ' . $wgSitename, // "Contact Form on" needs to be translated
	'SenderEmail' => null, // Defaults to $wgPasswordSender, may be changed as required
	'RequireDetails' => true, // Either "true" or "false" as required
	'IncludeIP' => true, // Either "true" or "false" as required
	'MustBeLoggedIn' => true, // Check if the user is logged in before rendering the form. Either "true" or "false" as required
	'AdditionalFields' => [
		'Text' => [
			'label-message' => 'emailmessage',
			'type' => 'textarea',
			'rows' => 20,
			'required' => true,  // Either "true" or "false" as required
		],
	],
        // Added in MW 1.26
	'DisplayFormat' => 'table',  // See HTMLForm documentation for available values.
	'RLModules' => [],  // Resource loader modules to add to the form display page.
	'RLStyleModules' => []  // Resource loader CSS modules to add to the form display page.
];

Additional steps

See the README file for further options to customize and adapt this extension.