Extension:ContactPage
リリースの状態: 安定 |
|
|---|---|
| 実装 | 特別ページ, フック |
| 説明 | Provides a contact form for visitors |
| 作者 | Daniel Kinzler, Sam Reed |
| 最新バージョン | Continuous updates |
| 互換性の方針 | スナップショットが MediaWiki とともにリリースされます。 master には後方互換性がありません。 |
| PHP | 5.4+ |
| データベースの変更 | いいえ |
|
|
| ライセンス | GNU 一般公衆利用許諾書 2.0 以降 |
| ダウンロード | README |
| 例 | nl.wikipedia.org |
| 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という名前のディレクトリ内に配置します。
開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ContactPage
- 以下のコードを LocalSettings.php ファイルの末尾に追加します:
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 customise and adapt as it convenes.
完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
$wgCaptchaTriggers['contactpage'] = true;
Further customisation
Adding a link to special page "Contact" to the footer
- Add the following code (with the correct URL inserted) to your
LocalSettings.phpfile:$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
See HTMLForm and related pages for more information on the possibilities available to create more complex forms.
Manual:HTMLForm チュートリアル 3 provides more details of the values that can be used for type value of fields under AdditionalFields.
For example, you can use 'type': 'usersmultiselect' to have a field that allows the selection of multiple usernames.
問題点
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.
関連項目
- 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
| この拡張機能は 1 つ以上のウィキメディアのプロジェクトで使用されています。 これはおそらく、この拡張機能が安定していて高いトラフィックのウェブサイトでも十分に動作することを意味します。 この拡張機能がインストールされている場所を確認するには、ウィキメディアの設定ファイル CommonSettings.php および InitialiseSettings.php 内で、この拡張機能の名前を探してください。 特定のウィキにインストールされている拡張機能の完全な一覧は、そのウィキの Special:Version ページにあります。 |
| この拡張機能は以下のウィキ ファーム/ウィキ ホスト/パッケージに含まれています: |
- Stable extensions/ja
- Special page extensions/ja
- Hook extensions/ja
- GPL licensed extensions/ja
- Extensions in Wikimedia version control/ja
- All extensions/ja
- Extensions used on Wikimedia/ja
- Extensions included in Canasta/ja
- Extensions included in Miraheze/ja
- Extensions included in ProWiki/ja
- Contact form extensions/ja
