Extension:ContactPage

This page is a translated version of the page Extension:ContactPage and the translation is 33% complete.
Other languages:
MediaWiki 拡張機能マニュアル
OOjs UI icon advanced-invert.svg
ContactPage
リリースの状態: 安定
MediaWiki-extensions-ContactPage.png
実装 特別ページ , フック
説明 Provides a contact form for visitors
作者 Daniel Kinzler, Sam Reed
最新バージョン Continuous updates
互換性ポリシー MediaWikiとともにリリースされるスナップショット。 master には後方互換性がありません。
MediaWiki >= 1.35.0
PHP 5.4+
データベースの変更 いいえ
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード
README
nl.wikipedia.org
  • $wgContactConfig
translatewiki.net で翻訳を利用できる場合は、ContactPage 拡張機能の翻訳にご協力ください

使用状況とバージョン マトリクスを確認してください。

Vagrant role contactpage
問題点 未解決のタスク · バグを報告

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.

インストールと設定

  • ダウンロードして、ファイルをextensions/フォルダー内のContactPageという名前のディレクトリ内に配置します。
  • 以下のコードをLocalSettings.phpの末尾に追加します:
    wfLoadExtension( 'ContactPage' );
    $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.
    ];
    
  • See the README file for further options to customize and adapt as it convenes. Note, however, that since March 2014, it is no longer possible to prefill text from MediaWiki:Contactpage-text-[form-name].
  •   完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

MediaWiki 1.27以前を稼働させている利用者へ:

上記の手順では、wfLoadExtension()を使用してこの拡張機能をインストールする新しい方法を記載しています。 この拡張機能をこれらの過去のバージョン (MediaWiki 1.27以前) にインストールする必要がある場合は、wfLoadExtension( 'ContactPage' );の代わりに以下を使用する必要があります:

require_once "$IP/extensions/ContactPage/ContactPage.php";
You can require a CAPTCHA test for the contact page, if you have the ConfirmEdit extension installed. CAPTCHAs are enabled by adding
$wgCaptchaTriggers['contactpage'] = true;
to "LocalSettings.php" below the invocation of both extensions.

Further customization

Adding a link to special page "Contact" to the footer of your wiki

To do this add ...

  1. ... the following code without changing it to your "LocalSettings.php" file:
$wgHooks['SkinTemplateOutputPageBeforeExec'][] = function( $skin, &$template ) {
	$contactLink = Html::element( 'a', [ 'href' => $skin->msg( 'contactpage-url' )->escaped() ],
		$skin->msg( 'contactpage-label' )->text() );
	$template->set( 'contact', $contactLink );
	$template->data['footerlinks']['places'][] = 'contact';
	return true;
};
  1. ... the URL of "Special:Contact" to system message MediaWiki:Contactpage-url and
  2. ... the label for "Special:Contact" to system message MediaWiki:Contactpage-label.
Creating more complex forms

See HTMLForm and related pages for more information on the possibilities available to create more complex forms.

Issues

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

  • 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