elleracompany / craft-cookie-consent

GDPR-Compliant cookie consent banner for Craft CMS
Other
6 stars 5 forks source link

Snaptcha compatibility #49

Closed johnwbaxter closed 3 years ago

johnwbaxter commented 4 years ago

Hi!

We're having real trouble with the Snaptcha plugin and the cookie-consent plugin.

Would you be able to add: public $enableSnaptchaValidation = false; to your controller please as per their docs? - https://putyourlightson.com/plugins/snaptcha#disabling-validation

Many thanks!

jellingsen commented 3 years ago

Hi!

We would like to not include support for other third party plugins directly in our source code, but rather give the developers the tools to solve these challenges by customizing the plugin.

The snaptcha issue can be solve by supplying your own template for the cookie consent banner. What you need to do is copy the file vendor/elleracompany/craft-cookie-consent/src/templates/banner.twig to your craft template folder. As an example, you can call it _banner.twig and save it in the root of your template folder. Then update the site settings accordingly Screenshot 2020-09-21 at 15 28 01.

You can now add {{ craft.snaptcha.field }} to the template (inside the form tags, so on line 3 for instance) and the snaptcha will work for the cookie consent plugin as well.