Jump to content

Erweiterung:ContactPage

From mediawiki.org
This page is a translated version of the page Extension:ContactPage and the translation is 70% complete.
MediaWiki-Erweiterungen
ContactPage
Freigabestatus: stabil
Einbindung Spezialseite , Hook
Beschreibung Bietet ein Kontaktformular für Besucher
Autor(en) Daniel Kinzler, Sam Reed
Letzte Version Continuous updates
Kompatibilitätspolitik Snapshots werden zusammen mit MediaWiki veröffentlicht. Der Master ist nicht abwärtskompatibel.
MediaWiki >= 1.43
PHP 5.4+
Datenbankänderungen Nein
Lizenz GNU General Public License 2.0 oder neuer
Herunterladen
README
Beispiel nl.wikipedia.org
  • $wgContactConfig
Quarterly downloads 48 (Ranked 92nd)
Übersetze die ContactPage-Erweiterung, wenn sie auf translatewiki.net verfügbar ist
Vagrant-Rolle contactpage
Probleme Offene Aufgaben · Einen Fehler melden

Die Erweiterung ContentPage implementiert ein Kontaktformular für Besucher. 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 und Konfiguration

  • Die Erweiterung herunterladen und die Datei(en) in ein Verzeichnis namens ContactPage im Ordner extensions/ ablegen.
    Entwickler und Code-Beitragende sollten stattdessen die Erweiterung von Git installieren, mit:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ContactPage
  • Folgenden Code am Ende deiner LocalSettings.php -Datei einfügen:
    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
        'NameReadonly' => false, // Set to "true" to make the name field read-only
        'EmailReadonly' => false, // Set to "true" to make the email address field read-only
        'SubjectReadonly' => false, // Set to "true" to make the subject line field read-only
        'MustHaveEmail' => false, // Set to "true" to require that the user submitting the form must have an associated email address
    	'AdditionalFields' => [
    		'Text' => [
    			'label-message' => 'emailmessage',
    			'type' => 'textarea',
    			'rows' => 20,
    			'required' => true,  // Either "true" or "false" as required
    		],
    	],
    	'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.
  • Yes Erledigt – Navigiere zu Special:Version in deinem Wiki, um zu überprüfen, ob die Erweiterung erfolgreich installiert wurde.
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.

Weitere Anpassung

  1. 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()
            );
        };
    };
    
  2. 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.

Probleme

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.

Siehe auch

  • Extension:EmailPage - Allows sending fully rendered articles with embedded CSS to users, groups, or contact lists
  • Erweiterung:CIForms - Forms with auto-validation, multiple choice questions and cloze tests