• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: CGBetterForms / Captcha - recapture div
PostPosted: Sat Aug 04, 2018 4:41 pm 
Offline
New Member
New Member

Joined: Sat Aug 04, 2018 4:20 pm
Posts: 7
I am using CGBetterForms with Captcha for my contact form.
I am using the recapture option for Captcha. I have my site key etc. But I cannot see how to add the 'data-size="compact"' attribute to the div that is subsequently generated.

I want the captcha div to be
<div class="g-recaptcha" data-sitekey="mysitekey" data-size="compact"></div>

but it is coming out as
<div class="g-recaptcha" data-sitekey="mysitekey"></div>

I do not want to change the source code in Captcha/plugins/recaptcha/cm_plugin.recaptcha.php which is where I think the code is coming from.

I tried copying this code to assets/module_custom/Captcha/plugins/recaptcha/cm_plugin.recaptcha.php and changing it there but it was ignored by CMSMS.

The reason for wanting to add this attribute is to make the Captcha thingy on the rendered form display better on small devices.

Any assistance appreciated. I am sure it is easy to do but cannot see wood for those pesky trees :)

BTW am loving the CGBetterForms and CMSMS version 2


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: CGBetterForms / Captcha - recapture div
PostPosted: Sat Aug 04, 2018 5:06 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 446
Location: Victoria, BC
Probably would need an option added to the Captcha module, which you may be able to have added by filing a feature request.

A workaround may be to just add it via jQuery:
Code:
$('.g-recaptcha').attr('data-size', 'compact');

(not tested)

_________________
Not getting the answer you need? CMSMS support options


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: CGBetterForms / Captcha - recapture div
PostPosted: Sat Aug 04, 2018 5:11 pm 
Offline
New Member
New Member

Joined: Sat Aug 04, 2018 4:20 pm
Posts: 7
Thanks for speedy response, Digi3.

I will try out that jQuery option and look into filing a feature request.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: CGBetterForms / Captcha - recapture div
PostPosted: Sat Aug 04, 2018 6:05 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 446
Location: Victoria, BC
Might have to get creative with redrawing the captcha after the data-attribute is added, but it's a starting point anyway.

If you did want to try the module_custom template method again, make sure you clear the cache after. Also, if it doesn't work in assets/module_custom/captcha/templates/, try just in /module_custom/captcha/templates/ (some modules seem to need the old method in order to work)

_________________
Not getting the answer you need? CMSMS support options


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: [SOLVED]CGBetterForms / Captcha - recapture div
PostPosted: Mon Aug 06, 2018 5:27 pm 
Offline
New Member
New Member

Joined: Sat Aug 04, 2018 4:20 pm
Posts: 7
Implemented the jQuery solution mentioned above. It was easy and simple to do and it worked.

I will also try your suggestion of putting the change in module_custom/captcha/templates and see if that also gives me what I want.

Thank you, Digi3


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting