Ich versuche, die neue "unsichtbare" Version des google reCAPTCHA auf meinem Formular zu bekommen.Wie implementiert man das neue unsichtbare reCAPTCHA auf Formular?
Ich bin mit den https://github.com/UndefinedOffset/silverstripe-nocaptcha
die Dokumentation nach, sollten Sie nur in der Lage sein, dies in der config.yml zu tun ändern, und ich nehme an, es unsichtbar sein würde?
default_size: "invisible"
-
public function HelloForm() {
$fields = new FieldList(
new TextField('Name'),
new EmailField('Email'),
new TextareaField('Message')
);
$actions = new FieldList(
new FormAction('doSubmitHelloForm', 'Submit')
);
$form = new Form($this, 'HelloForm', $fields, $actions);
$form->enableSpamProtection()
->fields()->fieldByName('Captcha')
->setTitle("Spam protection")
->setDescription("Please tick the box to prove you're a human and help us stop spam.");
return $form;
}
config.yml
NocaptchaField:
site_key: "MYKEYINHERE" #Your site key (required)
secret_key: "MYKEYINHERE" #Your secret key (required)
verify_ssl: true #Allows you to disable php-curl's SSL peer verification by setting this to false (optional, defaults to true)
default_theme: "light" #Default theme color (optional, light or dark, defaults to light)
default_type: "image" #Default captcha type (optional, image or audio, defaults to image)
default_size: "invisible" #Default size (optional, normal, compact or invisible, defaults to normal)
proxy_server: "" #Your proxy server address (optional)
proxy_auth: "" #Your proxy server authentication information (optional)
jedoch das Captcha noch zeigt, bin ich etwas fehlt? (Bitte beachten Sie, dass ich dies nur auf meiner lokalen Dev-Maschine atm).
Haben Sie flush nach Änderung der Konfiguration? –
@RobbieAverill - Ja, sicher. – ifusion
Ich glaube nicht, dass ein ReCaptcha-Modul derzeit die (brandneue!) Unsichtbare unterstützt. Ich würde jedoch vorschlagen, auf das chillu/silverstripe-recaptcha Modul umzusteigen, da es etwas besser gepflegt scheint und im Besitz von SilverStripes eigener Chillu ist. –