craftcms/contact-form-honeypot

为Craft CMS联系表单添加诱饵验证码

2.1.0 2024-03-19 21:18 UTC

README

此插件允许您在Craft CMS联系表单中添加一个诱饵验证码

要求

此插件需要Craft CMS 4.0.0+或5.0.0+,以及联系表单插件。

安装

您可以从插件商店或使用Composer安装此插件。

从插件商店

前往项目控制面板中的插件商店,搜索“Contact Form Honeypot”,然后在弹出的窗口中点击“安装”按钮。

使用Composer

打开终端并运行以下命令

# go to the project directory
cd /path/to/my-project.test

# tell Composer to load the plugin
composer require craftcms/contact-form-honeypot

# tell Craft to install the plugin
./craft plugin/install contact-form-honeypot

设置

要配置插件,请转到设置→联系表单诱饵,并选择诱饵字段应具有的参数名称。

然后编辑您的联系表单模板,并添加诱饵字段。

<input id="secretHoneypotParamName" name="secretHoneypotParamName" type="text">

您可以使用CSS隐藏该字段

input#secretHoneypotParamName { display: none; }