Extension:ContactPage
Appearance
![]() Release status: stable |
|
---|---|
![]() |
|
Implementation | Special page , Hook |
Description | Provides a contact form for visitors |
Author(s) | Daniel Kinzler, Sam Reed |
Latest version | Continuous updates |
Compatibility policy | Snapshots releases along with MediaWiki. Master is not backward compatible. |
PHP | 5.4+ |
Database changes | No |
License | GNU General Public License 2.0 or later |
Download | README |
Example | nl.wikipedia.org |
|
|
Quarterly downloads | 42 (Ranked 96th) |
Translate the ContactPage extension if it is available at translatewiki.net | |
Vagrant role | contactpage |
Issues | Open tasks · Report a bug |
The ContactPage extension implements a contact form for visitors. It creates a special page "Special:Contact", which is similar to "Special:EmailUser", but it has a fixed recipient, and may be used without registering.
Installation and configuration
[edit]- Download and move the extracted
ContactPage
folder to yourextensions/
directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ContactPage - Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'ContactPage' ); $wgContactConfig['default'] = [ 'RecipientUser' => null, // Must be the name of a valid account which also has a verified e-mail-address added to it. 'RecipientEmail' => 'Contact Form on ' . $wgSitename, // 'Contact Form on' needs to be translated 'RecipientName' => null, 'SenderEmail' => null, // Defaults to $wgPasswordSender, may be changed as required 'SenderName' => null, 'RequireDetails' => false, 'IncludeIP' => false, 'MustBeLoggedIn' => false, 'MustHaveEmail' => false, // True means the user submitting the form must have an associated email address 'NameReadonly' => false, 'EmailReadonly' => false, 'SubjectReadonly' => false, 'UseCustomBlockMessage' => false, 'Redirect' => null, 'RLModules' => [], // Resource loader modules to add to the form display page. 'RLStyleModules' => [], // Resource loader CSS modules to add to the form display page. 'AdditionalFields' => [ 'Text' => [ 'label-message' => 'emailmessage', 'type' => 'textarea', 'required' => true ], 'FieldsMergeStrategy' => null ];
- See the README file for further options to customize and adapt as it convenes.
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
You can require a CAPTCHA test for the contact page if you have the ConfirmEdit extension installed. CAPTCHAs are enabled by adding to "LocalSettings.php" below the invocation of both extensions.
$wgCaptchaTriggers['contactpage'] = true;
Further customization
[edit]- Add the following code (with the correct URL inserted) to your
LocalSettings.php
file:
$wgHooks['SkinAddFooterLinks'][] = function( Skin $skin, string $key, array &$footerlinks ) {
if ( $key === 'places' ) {
$footerlinks['contact'] = Html::element( 'a',
[
'href' => 'https://www.example.org/wiki/Special:Contact', // URL to "Special:Contact"
'rel' => 'noreferrer noopener' // not required, but recommended for security reasons
],
$skin->msg( 'contactpage-label' )->text()
);
};
};
- Add the label for "Special:Contact" to system message MediaWiki:Contactpage-label.
Creating complex forms
[edit]See HTMLForm and related pages for more information on the possibilities available to create more complex forms.
Issues
[edit]Users of some hosting providers such as SiteGround and Amazon SES may get a PHP mail error or one that says that the FROM email address is not configured in the server, despite $wgPasswordSender
being configured correctly and other email functionality working as expected.
A fix for this issue is described here .
See also
[edit]- Extension:EmailPage - Allows sending fully rendered articles with embedded CSS to users, groups, or contact lists
- Extension:CIForms - Forms with auto-validation, multiple choice questions and cloze tests
![]() | 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 wiki farms/hosts and/or packages: This is not an authoritative list. Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |
Categories:
- Stable extensions
- Special page extensions
- Hook extensions
- GPL licensed extensions
- Extensions in Wikimedia version control
- All extensions
- Extensions used on Wikimedia
- Extensions included in Canasta
- Extensions included in Miraheze
- Extensions included in ProWiki
- Extensions included in WikiForge
- Contact form extensions