Adding a Feedback Form to a ↓markdown↓ CMS Website
The ↓markdown↓® CMS (md-CMS) is a lightweight Content Management System (CMS), used for easy website management and article publishing. To help with website user engagement md-CMS supports website visitor feedback via a simple form. How do you enable the website feedback form in md-CMS? This is covered in this article.
Preparation for the md-CMS Feedback Form
To enable the md-CMS feedback form functionality the following is required:
- An email address is required, to which the submitted form data is sent.
- Sign up for Google's reCAPTCHA tool, choose reCAPTCHA v3 and register your domain. You will need a Google account to use reCAPTCHA.
- In the md-CMS configuration file, site-config.php, set the email address, site domain, reCAPTCHA site key and the reCAPTCHA secret.
Adding the Website Feedback Form to a md-CMS Website
When the feedback form is configured for a md-CMS based website, any page on the website that has the page meta-data Comments field set to Yes, i.e. in the page header, will show a feedback box at the end of the page. See the bottom of this web page for an example of the feedback form in action.
To configure the feedback form modify the configuration file site-config.php in the root directory. (To see how to create the site-config.php file see the article Website Home Page for ↓markdown↓ CMS.) Add the following configuration fields:
- RECAPTCHA_SITE - set to your websites reCAPTCHA site key.
- RECAPTCHA_SECRET - set to your websites reCAPTCHA secret key.
- FDBK_EMAIL - set to the email address of the person dealing with the website feedback.
- FDBK_DOMAIN - set to the root domain of the website, e.g. example.com.
Here's how they would look at the end of the $MD_SETTINGS array in the file site-config.php.
. . . "RECAPTCHA_SITE" => "YOUR_reCAPTCHA_site_key_goes_here_ABC123", "RECAPTCHA_SECRET" => "YOUR_reCAPTCHA_secret_key_goes_here_123A", "FDBK_EMAIL" => "email@example.com", "FDBK_DOMAIN" => "example.com" ); }
Once these items have been configured for your specific website settings in the site-config.php, a feedback form will appear at the end of any md-CMS web page that has the page header field Comments set to Yes.
Enabling Comments on an Article
In md-CMS the comments feedback form is enabled on a page by page basis. To enable comments on an article set the Comments article meta-data value to any value other than No, for example
Comments: Yes. (See the article Web Page Title Tag in ↓markdown↓ CMS for an introduction to article meta-data). For example with comments enabled for this web page the article meta-data is similar to the following:
/* Title: Adding a Feedback Form to a ↓markdown↓ CMS Website Published: 2020-08-22 Comments: Yes */
With the meta-data setting
Comments added for an article the comment feedback form then displays at the bottom of the article. See the bottom of this post for an example.
A visitor to the page can fill out the feedback form and it will post the comment back to the website server. The server then sends an email to the email address set in the configuration file. The email includes the web address of the page that the comment was entered on. This allows the person dealing with feedback to know the website page to which the comment refers. If required that page can then be modified to respond to the comment.
- There are more tutorials covering ↓markdown↓ CMS in the article Build a Website from Scratch with ↓markdown↓ CMS.
- For technical details on reCAPTCHA see the article reCAPTCHA Code to Download for Demo and Test.
- View the Tek Eye full Index for other articles.
Author:Daniel S. Fowler Published: