Installing the Modern Contact plugin in DokuWiki

Installing a Contact form on your DokuWiki site can be somewhat complex. DokuWiki does not have any contact form capability built into their software. In order for you to get a contact form on your DokuWiki site, you will need to use a plugin.  This tutorial will explain how to use the Modern Contact plugin for DokuWiki.

Steps to use the Modern Contact plugin

Download and Install the plugin

In order to create a contact form in your wiki you will need to use the Modern Contact plugin. The following explains where to download and how to install the plugin.

  1. Contact form plugin download DokuWiki

    Visit the following url where the plugin can be downloaded from.

    https://www.dokuwiki.org/plugin:contactmodern

    Click the Download link.


  2. Copy the Modern Plugin link DokuWiki

    Get the URL for the plugin. You can right click the download link and copy the Link Location or get the link from the browser address bar. The link for the plugin should look like the following.

    https://github.com/downloads/marvinrabe/dokuwiki-contact/moderncontact_2012-06-06.zip


  3. text

    Log into DokuWiki.

    Click the Admin link at the top right side.

    Select the “Manage Plugins” link.


  4. Install Modern Contact plugin DokuWiki

    Paste the URL you obtained from the plugin download site in the “Download and install a new plugin” box.

    Click Download.


    Green success DokuWiki

    You should see a green confirmation saying, “Plugin package (2 plugin(s
    ): __MACOSX,moderncontact) successfully installed
    “.


    Installed plugins DokuWiki

    Now the plugin will show in the “Installed plugins” list.

Add Modern Contact plugin code

Once you have the Modern Contact plugin installed, you can add the code to your wiki page that is designed to store your Contact form. The following are example codes you can use in your wiki Contact page.

{{contact>}}
{{contact>subj=Contact the Developer}}}
{{contact>to=Admin|subj=Contact the Developer}}

The table below has a brief description of the attributes available for the contact form code.

AttributeDescription
subjThis will allow the subject to be specified in the form removing the subject input from the contact form.
toThe username can be specified here for having a specific user receive the email from the form.
captchaThis can be set to True or False. True will display the reCAPTCHA and false will hide it.

Below are the steps to add the code to your wiki page.

  1. Find the page you want to add the contact form to and edit it.
  2. Add code to your wiki page DokuWiki

    To have the basic form display, add the following code to your page.

    {{contact>}}

    Save the changes.

    Before the contact form will display on your page, you will need to fix the code in the plugin. The following will explain how to fix the plugin code.


Fixing the Modern Contact plugin code

To fix the code, we will need to “find and replace” a specific code in one of the files of the plugin. This is because the plugin developers have not created a fix for a bug in the plugin.

Important! When using find and replace, its important to make sure you typed the words correctly and that you have a backup of the plugin. Find and replace cannot be undone so be careful.

Below are the steps to take for finding and replacing the code to make the Modern Contact form to work.

  1. Login into your cPanel.
  2. Go to the File Manager. Select your DokuWiki installation directory and click go.
  3. Navigate to the following file location.

    lib/plugins/moderncontact/syntax.php

    Open the file in the code editor.

  4. Find and replace bad code DokuWiki

    Press Ctrl + F on your keyboard to open the find and replace box. Find and replace the following code:

    contactmodern

    Replace it with the following:

    moderncontact

    Open the file in the code editor.

    Save the changes.


Configure the Modern Contact plugin Settings

In order for the Contact form to work completely, you will need to configure the plugin. You can get a “reCAPTCHA” key from Google to have the “reCAPTCHA” work on your form. The below steps will explain how to configure the Modern Contact plugin.

For more information on the Google “reCAPTCHA” private and public keys, please see our article on How to get the public and private keys for Google reCAPTCHA.

  1. Log into DokuWiki.
  2. Click the Admin link at the top right.

    Select the Configuration Manager.

  3. Configure plugin settings DokuWiki

    Scroll to the bottom where it has the Moderncontact Plugin Settings.

    Here is where you configure the plugin. You can change the default email address for the contact form and enable the captcha here. This is where you will use your Google “reCAPTCHA” public and private keys.

    Save the changes.


    View of Modern Contact Plugin DokuWiki

    Now when you visit the page where you placed the contact form code, you will see the basic contact form show.

Was this article helpful? Join the conversation!

Questions about our MailChannels Deployment? We have answers and are here to help!Learn More
+