Extensão: ContactPage
Estado de lançamento: estável |
|
|---|---|
| Implementação | Página espacial, Hook |
| Descrição | Fornece um formulário de contacto para os visitantes |
| Autor(es) | Daniel Kinzler, Sam Reed |
| Última versão | Continuous updates |
| Política de compatibilidade | Lançamentos de capturas de ecrã em conjunto com o MediaWiki. Original não é compatível com as versões anteriores. |
| PHP | 5.4+ |
| Alterações à base de dados | Não |
| Licença | GNU - Licença Pública Geral 2.0 ou superior |
| Transferência | README |
| Exemplo | nl.wikipedia.org |
|
|
| Traduza a extensão ContactPage se esta estiver disponível em translatewiki.net | |
| Função no Vagrant | contactpage |
| Problemas | Tarefas em aberto · Reportar um erro |
A extensão ContactPage implementa um formulário de contacto para os visitantes. Esta cria uma página especial "Especial: Contacto", que é semelhante a "Especial: "EmailUser", mas tem um destinatário fixo, e pode ser utilizada sem registo.
Instalação e configuração
- Exporte e coloque o ficheiro, ou ficheiros, num diretório chamado
ContactPage, na sua pastaextensions/.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ContactPage
- Acrescente o seguinte código ao fundo do ficheiro $LocalSettings:
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.
Pronto – Na página especial Special:Version da sua wiki verifique se a extensão foi instalada.
$wgCaptchaTriggers['contactpage'] = true;
Personalização adicional
Adicionar uma hiperligação à página especial "Contacto" para 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 Tutorial 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.
Problemas
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.
Consultar também
- 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
| Este extensão está a ser utilizado em um ou mais projetos da Wikimedia. Isso provavelmente significa que a extensão é estável e funciona bem o suficiente para ser usada por esses sites de alto tráfego. Procure o nome desta extensão nos arquivos de configuração CommonSettings.php e InitialiseSettings.php da Wikimedia para ver onde está instalado. Uma lista completa das extensões instaladas em um determinado wiki pode ser vista na página Special:Version do wiki. |
| This extension is included in the following wiki farms/hosts and/or packages: |
- Stable extensions/pt
- Special page extensions/pt
- Hook extensions/pt
- GPL licensed extensions/pt
- Extensions in Wikimedia version control/pt
- All extensions/pt
- Extensions used on Wikimedia/pt
- Extensions included in Canasta/pt
- Extensions included in Miraheze/pt
- Extensions included in ProWiki/pt
- Contact form extensions/pt
