Giter Club home page Giter Club logo

Comments (3)

nenes25 avatar nenes25 commented on August 27, 2024

Hello,

In order to make it work with your implementation, you need to edit the line : https://github.com/nenes25/eicaptcha/blob/17/eicaptcha.php#L314
and to add
|| $this->context->controller instanceof CmsController

So the specific js will be loaded in cms page too.

Regards,

from eicaptcha.

tomi02 avatar tomi02 commented on August 27, 2024

Hello
Thank you for your answer.
I added to the eicaptcha.php
//Add Content box to contact form page in order to display captcha if ( $this->context->controller instanceof ContactController || $this->context->controller instanceof CmsController && Configuration::get('CAPTCHA_ENABLE_CONTACT') == 1)

On the cms page, the head section has been added
<link rel="stylesheet" href="http://xxx/modules/eicaptcha/views/css/eicaptcha.css" type="text/css" media="all">

It has not been added
<script type="text/javascript"> //Recaptcha CallBack Function var onloadCallback = function() {grecaptcha.render("captcha-box", {"theme" : "light", "sitekey" : "6Ldv3EsUAAAAACjUJxxxxxxxxxxxx"});}; </script><script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit&hl=" async defer></script>

In body section was added only
<div id="captcha-box"></div>
It has not been added
<div id="captcha-box"><div style="width: 304px; height: 78px;"><div><iframe src="https://www.google.com/recaptcha/api2/anchor?k=6Ldv ......

So the recaptcha window did not appear on the cms page.
Regards.

Edit
In eicaptcha.php I added
|| $this->context->controller instanceof CmsController
In this place:
https://github.com/nenes25/eicaptcha/blob/17/eicaptcha.php#L329
if ( $this->context->controller instanceof ContactController || $this->context->controller instanceof AuthController || $this->context->controller instanceof CmsController )
And everything started working
Thank you.

from eicaptcha.

nenes25 avatar nenes25 commented on August 27, 2024

OK great if it works :-)
So i close the issue

Regards,

from eicaptcha.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.