How to display the visitor message form and manage the message results in AnQiCMS?

Calendar 👁️ 66

Interacting with website visitors, collecting user feedback is a very important link that every website operator attaches great importance to.Whether it is to answer questions, collect suggestions, or provide customer service, a highly efficient and convenient message system can greatly enhance user experience and operational efficiency.AnQiCMS fully understands this and provides us with a simple and efficient visitor message function, making the whole process from form display to result management effortless.

Build a visitor message form easily

To display a visitor message form on the website front end, AnQiCMS adopts a flexible template tag method. Usually, we will create a namedguestbook/index.htmlThe template file to carry the message function, but can also be called according to your design preference on any page where the message form needs to be displayed.

The core in the template is{% guestbook fields %}...{% endguestbook %}This tag. It dynamically retrieves all the comment fields we configure on the backend and presents them asfieldsThe array is passed to us. This means that no code modification is needed, as the front-end form will automatically update as long as the fields are adjusted in the background.

AnQiCMS cleverly treats each comment field asfieldsan element of an arrayitemto process. Eachitemcontains all the information required by the form, such as:

  • item.NameField display name, such as "Your Name", "Contact Information".
  • item.FieldNameField name used in background and submission, likeuser_name/contact.
  • item.TypeField input type can betext(Single-line text),number(Number),textarea(Multi-line text),radio(Single choice),checkbox(Multiple choice) orselect(Dropdown select).
  • item.Required: A boolean value indicating whether the field is required.
  • item.Content: Field default prompt text (placeholder).
  • item.Items: If the field type isradio/checkboxorselect, this array will contain all options.

We can use a simpleforLoop throughfieldsarray to generateitem.Typedifferent types of input boxes dynamically. For example, fortextornumberfields of this type, we can generate<input type="{{item.Type}}" name="{{item.FieldName}}" ...>; fortextareaIt generates<textarea name="{{item.FieldName}}" ...>; For selection types, we can further loopitem.Itemsto generate specific options.

Form submission is very direct, just need toformlabel'sactionproperty points to/guestbook.htmland it is.user_name(Username of the commentor),contact(Contact information),content(Comment content) In addition to these core fields, all the custom fields we define on the backend will be submitted as well. If you want to get a JSON format return result instead of the default HTML after submission, you can add a hidden field in the form<input type="hidden" name="return" value="json">.

To prevent spam and malicious submissions, it is recommended to integrate a captcha into the comment form.AnQiCMS provides a convenient captcha feature.captchafield, a hidden onecaptcha_idfield and one used to display a captcha imageimglabel, accompanied by simple JavaScript code calls/api/captchaThe interface can dynamically load and refresh captcha, effectively enhancing the form security.

Flexible configuration of message fields

The strength of the comment form lies in its high customizability. AnQiCMS allows us to flexibly configure the comment fields according to specific business needs.

Go to the "Function Management" menu in the background, where you will find the "Website Message Management" option.In here, you can easily add, edit, or delete form fields.Whether you need to collect customers' phone numbers, email addresses, company names, or provide a multiple-choice option about product preferences, you can customize it here.You can define clear names for each field, choose the appropriate input type (single-line text, number, multi-line text, radio, checkbox, dropdown), and set whether it is required, even presetting option values for the selection type fields.This flexibility ensures that the comment form can perfectly adapt to various information collection scenarios without any code modification.

Efficiently manage visitor message results

After the visitor submits a message, all information will be displayed in the "Function Management" -u003e "Website Message Management" area on the backend.Here is a straightforward list for quick browsing and managing all comments.

On the comment management interface, we can conveniently view the detailed content of each comment, including the submitter's username, contact information, comment time, and information about all custom fields.For messages that are no longer needed or confirmed to be spam, the delete operation can be performed.AnQiCMS also supports the export of message content, which is very useful for data analysis or archiving backup.

It is worth mentioning that AnQiCMS also supports the feature of leaving message email reminders.After configuring the email server information in the background, once there is a new message submitted, the system will automatically send an email notification to ensure that we do not miss any important user feedback or potential business opportunities and can respond to customer needs in a timely manner.

From the frontend-friendly form display, to the flexible field configuration on the back-end, to the convenient message management, AnQiCMS provides a one-stop solution.It not only simplifies the development and maintenance of the website comment function, but also helps us interact more effectively with visitors, collect valuable information, and thus promote the continuous development and optimization of the website.


Frequently Asked Questions (FAQ)

1. Where can I configure the style and custom fields of the message form?The form structure and custom fields are configured in the "Function Management" -> "Website Message Management" of the AnQiCMS backend.You can add, edit fields, set their types, names, whether they are required, and so on.guestbook/index.htmlImplement it with CSS in the ).

How to enable the留言邮件提醒功能 to ensure you don't miss any visitor messages?AnQiCMS supports留言mail reminders.You need to configure the SMTP email server information in the "Function Management" -> "Email Reminder Management" on the back end, including the sender's email, password, SMTP server address, and port.After configuration is complete, once new messages are submitted, the system will automatically send an email notification to the email address you specified.

Can you add a captcha to the留言表单? What is its purpose?Yes, the message form can add a captcha.After enabling the captcha feature in the AnQiCMS backend, you need to add the corresponding captcha display and input fields to the front-end message template.The main function of captcha is to prevent automated programs (such as spam comment robots) from malicious submissions or sending a large amount of spam, thereby protecting the cleanliness of the website content environment and data security.

Related articles

How to implement content list filtering by custom parameters in AnQiCMS?

In AnQi CMS, flexibly displaying and filtering content is one of the core needs for website operation.As the content structure of a website becomes increasingly complex, for example, if you operate an e-commerce platform that needs to filter products by color and size, or a real estate website that needs to filter housing resources by type and area, traditional classification tags may be insufficient.This is using the powerful custom parameter function of Anqi CMS, which can easily realize the filtering and display of content lists according to the parameters you define, greatly enhancing user experience and the organization efficiency of website content.

2025-11-08

How to display category thumbnails or Banner group images in AnQiCMS?

The visual presentation of website content is the key to attracting users and enhancing experience.Especially on the category page, a beautiful thumbnail or a set of eye-catching banner images can make the content clear to the user and stimulate browsing interest.AnQiCMS as a powerful content management system, provides a flexible image management and calling mechanism, allowing you to easily set and display unique visual elements for website categories.### One, Background Configuration: Add Visual Attraction to Your Categories Firstly, you need to make the corresponding configuration in the background to display images for categories in AnQiCMS

2025-11-08

How to set the website to "closed" status and display a custom prompt message in AnQiCMS?

During the operation of the website, it is sometimes necessary to temporarily close the website, whether it is for system upgrades, data maintenance, or a brief adjustment of content, AnQiCMS provides a simple and efficient shutdown feature to help us elegantly manage the temporary shutdown status of the website.This not only avoids the user from seeing an error page and affecting the experience, but also clearly conveys information and maintains the brand image. We will learn in detail how to set the website to "closed" status in AnQiCMS and display personalized prompt information.

2025-11-08

How to use Tag labels in AnQiCMS to associate and display related documents on the front end?

AnQiCMS provides powerful classification functions to organize the website structure, and also opens up new ways for deep association and multi-dimensional display of content through flexible Tag label mechanisms.Imagine that your website is like a library, with different shelves for categories, and Tag tags are like different subject keywords on books, allowing readers to find books with similar themes scattered on different shelves according to their interests.Next, let's delve into how AnQiCMS uses Tag labels to make your website content more intelligent and rich in front-end display

2025-11-08

How to retrieve and display details of a specific user group (such as VIP level) in AnQiCMS template?

In AnQiCMS, managing users and content, we often encounter the need to display different information based on the user's identity (such as VIP level).The powerful template engine and user group management function of AnQiCMS makes it very intuitive and efficient to achieve this goal. Today, let's discuss how to retrieve and flexibly display detailed information of specific user groups in the AnQiCMS template, such as the name of the VIP level.

2025-11-08

How does AnQiCMS filter or replace external links in content to standardize display?

External links contained in website content, if not managed properly, may have a negative impact on the website's search engine optimization (SEO) effect, user experience, and even the quality of the content.AnQiCMS as a comprehensive content management system, provides a series of powerful and flexible tools to help you effectively filter or replace external links in the content, ensuring the standardized display of website content.

2025-11-08

How to generate random text of a specified length as placeholder content in AnQiCMS template?

## Generate random text of a specified length as placeholder content in AnQiCMS template During website development and content operation, we often encounter scenarios where we need to fill in placeholder content (Placeholder Content).Whether it is designing a new template, testing page layout, or giving an initial preview when the content is not fully ready, placeholder text can help us quickly build prototypes, intuitively evaluate the visual effects, and do not need to wait for the real content to be filled in.

2025-11-08

How to debug template in AnQiCMS and view the structure and value of variables (using dump filter)?

When developing website templates, we often encounter such confusion: what data does a variable in the template contain?What is its structure? What is the type? And what is the specific value?If these questions cannot be answered quickly, the debugging process will become extremely繁琐and time-consuming.Fortunately, AnQiCMS has provided us with a powerful and convenient debugging tool——`dump` filter, which can help us easily reveal the true face of variables.AnQiCMS developed in Go language, using a template engine syntax similar to Django

2025-11-08