Recaptcha in contact pages

Yeah chasing down a problem is always tough, especially on a whole site someone else setup.

I am concerned about recaptcha with that Json builder. I did not get one hit for recaptcha on that site or just using the name of the builder. It seems like a feature that hasnā€™t been added yetā€¦

Youā€™re telling me! Imagine doing it on a system Iā€™ve never used before too. Sorry ModX. I feel bad, but Iā€™d never heard of this before eitherā€¦ (Yes have read threads about how itā€™s advertised etc so ā€¦ maybe some insights into that?)

Tbh I am still struggling.
Not one to quit but I am now slowly starting to get confused with added/not added and so forth.
The funny thing is, using the existing setup and adding this code from @vibedesign adds a login checkbox, so obviously something is working while the rest isnā€™t;

To use his code, make sure you have formit extra installed, and the recaptcha2 extra as well

The core is kept apart from a lot of ā€˜basicā€™ functionality, for security and continuity. Some basic user capabilities exist, but the core is ā€˜justā€™ the core. Most ā€˜coreā€™ functionality are extras, even basic stuff

Modx seems mostly marketed towards developers. Its got a secure framework unlike wordpress.

This forum is part of an attempt to make access easier for all types of users, and make it easier for new users to get up and running. Modx can do so many things, that figuring out how to do something can be a task ha

Yes, have both working here. I installed recaptcha add-on/plugin/mod which has V.2 and V.3 combined, and am using Formit Extra.
Oddly it pulled a login field which was uneditable and didnā€™t work. But had a click response.
So something happened, but not sure what exactly.

On that note, I am thinking of still making new templates, new pages and adding things from there (including the HTML elements set up) and seeing what happens.
It must be purely from having out of date coding in there. Itā€™s all I can think of.
Iā€™ll make a new page & template and see if I can pull it all from that.

Yes pls start fresh, this code should work. If you are ok with your html, then take for example the siteā€™s standard template, copy it, cut out the [[*contents]] tag and put your call right in the template along with the form html. Then youā€™ve got basic styling. Attach the template to an empty resource and view the resource.

Although for testing just make the roughest of html structures, just in case the regular template has something conflicting, doesnā€™t seem likely butā€¦if it works in the simple one, its likely to work with the real one.

1 Like

Thank you.
Itā€™s almost midnight here but will be back on it again in a few hours.
I canā€™t work out why some snippets (as in code snippets) will work while others donā€™t. Itā€™s very perplexing. Almost like a total language failure.
Anyway, fresh eyes tomorrow. Will definitely take you up on the rest tomorrow and see what happens. Will drop all but the basic of HTML to see what is going on.
Thank you so much for all of your help so far.

2 Likes

The login field comes from the default recaptchav2_invisible_html chunk. Have you created this for your own yet? Like in my code example above, Iā€™ve deleted the login part (which is the last line in the default chunk).

// I removed this part in my chunk:

<!-- <button type="submit" class="g-recaptcha" name="login" data-sitekey="[[+site_key]]" data-callback="recaptchaV2SubmitForm">Login</button> -->
1 Like

Ah great mystery solved. And proper form is to change the name of that chunk and in the call, so that it wonā€™t get overwritten later. But, with Modx, that would happen pretty rarely

@vibedesign great help

@Squashed_Tomato well with the formitbuilder call, we know thatā€™s old, so while the problem could be simple, we would never know really. And it could break again tomorrow. Extras in Modx can last a very long time, so when they are depreciated then I think its truly over lol.

Youā€™ll get there!

Rightā€¦ am with you!
Okay so a chunk is the same as the same as a basic code macro yes?
Then no, I literally (lazily) copied your text into some basic page & templates I made to see what happened. Think I need to just do some more homework and see whatā€™s up here.

Something so simple, adding a recaptcha, has turned into such a time consuming, massive, and page upon page search request.
Sheeshā€¦
That said, I canā€™t justify Ā£100 just to add ReCaptcha which the devs are requesting to help. I know we all need to make Ā£s but itā€™s not justifiable for something as basic as anti-spam. (Donā€™t shoot me, am the messenger)

Will come at this again later tomorrow morning to see what I have missed and what needs adding.
Thanks again for the really helpful supportā€¦ :slight_smile:

Well, again youā€™ve upgraded, because things were a bit broken. For an experienced developer, this is certainly a few hours work max.

For @vibedesign s code, first paste it into a simple html structure, then if it works paste it as I said into the content section of a copied standard website template from the site. Then you can style more if needed, it will match the site, and you can implement it. Then, if you want to get fancy, take that same piece of code, put it into a chunk, and call the chunk in the template.

The behavior will be exactly the same.

Chunks are pieces of code, I guess any code can go in there. They are handy for example to hold your header, so that you can go right to that code really easily, and change it on multiple templates.

Like contact details could be in chunks, easy to get at and change, and also you can deliver the chunks you want, might have a quick location checker and deliver local info. Or head contents, which need to be updated sitewide. Keep in mind some sites will have multiple banners, footers, everything

Snippets are more the tools, its easy to make a snippet to get all the products and sort or search them for something, or users or whatever data you want.

1 Like

Iā€™m late to this party, but have a couple of comments:

  1. The UpgradeMODX extra makes it a lot easier and more reliable to upgrade MODX.

  2. The SPForm extra installs a spam-proof contact form and is quite simple to install (it usually works out of the box). I use it at Bobā€™s Guides and get no spam at all without using any form of Captcha. It has a number of spam-proofing options (including traditional Captcha with the math option).

2 Likes

To be a little more precise, chunks are used for general HTML code (and scripts, etc.). Like @nuan88 mentioned you want to use those for elements on your site which occur in several templates (like a navigation, head-section, footer, etc.) so you have one place to update them on all sites.

Snippets are used the same way, but are made for processing PHP code.

1 Like

Well, again youā€™ve upgraded, because things were a bit broken. For an experienced developer, this is certainly a few hours work max.

For @vibedesign s code, first paste it into a simple html structure, then if it works paste it as I said into the content section of a copied standard website template from the site. Then you can style more if needed, it will match the site, and you can implement it. Then, if you want to get fancy, take that same piece of code, put it into a chunk, and call the chunk in the template.

The behavior will be exactly the same.

Chunks are pieces of code, I guess any code can go in there. They are handy for example to hold your header, so that you can go right to that code really easily, and change it on multiple templates.

Like contact details could be in chunks, easy to get at and change, and also you can deliver the chunks you want, might have a quick location checker and deliver local info. Or head contents, which need to be updated sitewide. Keep in mind some sites will have multiple banners, footers, everything

Snippets are more the tools, its easy to make a snippet to get all the products and sort or search them for something, or users or whatever data you want.

Good morning.
Right got you. Yes makes senseā€¦ I can see the fluidity of it and certainly makes sense.
Yes the good thing is a significant upgrade! When I first got into the site I knew we had an issue immediately with out of date software.

Iā€™m late to this party, but have a couple of comments:

  1. The UpgradeMODX extra makes it a lot easier and more reliable to upgrade MODX.
  2. The SPForm extra installs a spam-proof contact form and is quite simple to install (it usually works out of the box). I use it at Bobā€™s Guides and get no spam at all without using any form of Captcha. It has a number of spam-proofing options (including traditional Captcha with the math option).

Hi!
Aha I did see that SPForm when initially doing some digging two weeks ago. But, didnā€™t think we could apply it as the forms seemed totally different to what we had? Now I know however, that itā€™s because they were using obsolete code.
So I will have a look, thank you.
I can make a contact page pretty easily, but understanding the work flow on Modx is the culture shock more than anything I think. Learning curve. Thank you for that, will take a peek. :slight_smile:

To be a little more precise, chunks are used for general HTML code (and scripts, etc.). Like @nuan88 mentioned you want to use those for elements on your site which occur in several templates (like a navigation, head-section, footer, etc.) so you have one place to update them on all sites.

Snippets are used the same way, but are made for processing PHP code.

Aha okay makes perfect sense. I can understand that. Jigsaw pieces are coming together. I think towards the end of last night, Iā€™d been at it so long, Iā€™d started to confuse myself - even over basic stuff.

1 Like

Make sure to check the Tutorial Section, where @lkfranklin made (and still is making) great videos covering the basics like this one:

1 Like

Thank you for the link! I appreciate it. Indeed, I found one of their video tutorials a few days ago, which was really intuitive, purely from Googling for solutionsā€¦ Will see what more is there. Thank you again!
Been a very busy day so far so not had chance to get on this yet, but about to make a start. :slight_smile:

1 Like

Hi again,
Silly question but is there an area for posts about the SPForm extra?
I did a site search and it shows me this thread but nothing more.

Reason being, I have it installed and Iā€™ve customised it, but when sending emails I get a weird error - "
Error: The captcha plugin must be installed to use captcha in spform." I have reinstalled it 3-4 times now.
Will keep trying and searching at the same time. I know itā€™s not the right thread, but I canā€™t find any more info about it aside from what is on here?
Many thanks in advance.

I may try to set up recaptcha again on the current page. This is now becoming very frustrating.

No, there are no more topics for each specific extra on these new forums.

Just create new topics whenever a different question comes up; this spform question does seem like a new problem from the rest of the thread.

1 Like

Hi @markh Okay thank you.
Iā€™ve now managed to get the maths anit-spam working, so now more of a styling and customisation situation (for sent mail, contact page et al) really.
Oh and the error message means you need this extra as well as SPForm;
https://modx.com/extras/package/captcha
FTR; I have again tried to get it going but to no avail so obviously that FormitBuilder is too obsolete.
Thanks again.

Did you get the CC working?

1 Like

Hi Bob,
Unfortunately as of yet no.
I have entered the email in snippet > mailalso but nothing happens.

The rest (in this thread) I am still working on as we speak. :slight_smile: