Forums

Size of noCaptcha: compact g-recaptcha tag

flodariege 27 Aug, 2015
Hello,

I use CF for a little form on the left side of some of my pages, and I need to tell the Google noCaptcha to be compact because it is now wider than than my left menu, and it is not very nice.

Here : https://developers.google.com/recaptcha/docs/display#config , I found this:

g-recaptcha tag attributes and grecaptcha.render parameters
g-recaptcha tag attribute grecaptcha.render parameter Value Default Description
(...)
data-size size compact normal normal Optional. The size of the widget.
(...)

So it is apparently possible to have noCaptcha being compact instead of normal.
But....
... where in Chronoforms am I supposed to enter this tag?
I tried to write
data-size="compact" in the code tab, but it did not change anything.
I supposed I am not doing it the right way.

Any help would be very welcome😉

Flo
marmerk 15 Sep, 2015
Hi
Had to place CF in sidebar too .
This work for me.
Change this file load_nocaptcha.php

in administrator\components\com_chronoforms5\chronoforms\actions\load_nocaptcha.php

line 28 aprox. add data-size="compact"

$recaptcha_load = '<div class="g-recaptcha" data-size="compact" data-sitekey="'.$config->get('site_key').'"></div>';

Hope this helps.
Bye
flodariege 20 Sep, 2015
Hi marmerk,

Thank you for your help, it does help a lot🙂

I still regret this parameter cannot be changed inside chronoform configuration, since the size needed for the captcha can be very different depending on the forms...
For example, in my other forms, the compact version looks a little weird.
But it's still a lot better looking weird in some places, and fitting in the sidebar rather than looking good in most forms but modifying the whole layout of the page when the captcha is wider than the sidebar where it lays.
So, thank you again.
And if someone knowss how to change this parameter disctintively for each form, I'm still interested.

Flo
GreyHead 21 Sep, 2015
Hi,

This is definitely a fudge - but seems to work. You can add the extra parameter on the end of the Site Key box like this
6L. . .n3w" data-size="compact
Note exactly where the "s are though.

You can set the theme to light or dark and the style to image or audio in the same way:
6L. . .n3w" data-size="compact" data-style="audio" data-theme="dark


Bob
flodariege 21 Sep, 2015
Hi Bob,

Ouiiiiiiiiiiiiiiiiiiiii ! As we say here in France🙂
It works great, and does exactly what I need.

Thank you.

Florence
This topic is locked and no more replies can be posted.