upassist/neos-recaptcha
最新稳定版本:2.0.1
Composer 安装命令:
composer require upassist/neos-recaptcha
包简介
reCaptcha v3 for Neos CMS forms (Neos 9+)
README 文档
README
Provides a solution to use reCaptcha v3 in nodebased forms in Neos.
Versions
| Branch | Supports | Composer |
|---|---|---|
main |
Neos 9.0+ | composer require upassist/neos-recaptcha:^2.0 |
neos-8 |
Neos 7 / 8 | composer require upassist/neos-recaptcha:^1.2 |
Install
composer require upassist/neos-recaptcha:^2.0
Configure
Add the mixin UpAssist.Neos.ReCaptcha:Mixin.ReCaptchaConfiguration to your homepage.
Make sure to register at https://www.google.com/recaptcha.
Usage
Add a reCaptcha field to your form.
Add the reCaptcha finisher as first finisher to your finishers. If the reCaptcha fails, the other finishers won't be
executed anymore.
The finisher has a threshold option (default 0.5) that you can change in the Neos inspector.
Script Inclusion
The Google reCaptcha API script should be included once, just before </body>.
In projects with custom document/page prototypes, the safest approach is to add it to body.javascripts so it is
appended by your page template pipeline:
prototype(Neos.Neos:Page) {
body.javascripts.recaptchaApiScript = Neos.Fusion:Tag {
@position = 'end 900'
@if.hasSiteKey = ${q(site).property('recaptchaSiteKey')}
tagName = 'script'
attributes.src = ${'https://www.google.com/recaptcha/api.js?render=' + q(site).property('recaptchaSiteKey')}
}
}
If your custom document prototypes redefine body or body.javascripts, make sure this script entry is also added in
those prototypes so it is not dropped by overriding.
统计信息
- 总下载量: 230
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-03-06