We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26459
    • 12 Posts
    After updating FormIt to 1.3.0 the recaptcha theme has been changed to ’clean’. I changed the theme to ’red’ in the FormIt snippet but to no avail. The frontend keeps displaying the clean theme. Am I missing something?

    FormIt snippet:
    $recaptchaTheme = $modx->getOption('recaptchaTheme',$scriptProperties,'red');


    Frontend:
    var RecaptchaOptions = {"theme":"clean","width":450,"height":300,"lang":"en"}
      • 3749
      • 24,544 Posts
      The third argument to getOption (in your case ’red’) is a default value that will only be used if getOption() fails to find the setting. Since ’clean’ is set in the default properties of the snippet, it’s found and used.

      All you really needed to do was add the following parameter in the FormIt snippet tag:

      &recaptchaTheme=`red`

      That will override the default property. It’s almost never necessary (or advisable) to mess with the code of a component.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 26459
        • 12 Posts
        Thanks! Works like a charm.
          • 3749
          • 24,544 Posts
          Quote from: scs at Oct 04, 2010, 08:04 AM

          Thanks! Works like a charm.

          I’m glad you got it working. smiley
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 28449
            • 8 Posts
            Hi,

            when I tried the "Simple Contact Page" tutorial for FormIt (http://rtfm.modx.com/display/ADDON/FormIt.Examples.Simple+Contact+Page)
            and want to use another Theme, by placing &recaptchaTheme=`red` before the &hooks for the FormIt:
            [[!FormIt?
               &recaptchaTheme=`red`
               &hooks=`recaptcha,spam,email,redirect`  

            than it works, the theme is the red one
            but when I want to use the same for the lang (or even theme) in the &recaptchaJS, I can’t get it to work
            [[!FormIt?
               &recaptchaJS=`theme:red,lang:nl`   // or what is the correct, i've tried several but can't find this working?
               &hooks=`recaptcha,spam,email,redirect`  
              • 28215
              • 4,149 Posts
              Try:
               &recaptchaJS=`{"theme":"red","lang":"nl"}`
              
                shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                • 28449
                • 8 Posts
                I’ve tried that already!
                That doesn’t work!

                When I use &recaptchaJS=`{"theme":"red","lang":"nl"}` and look in the source it still remains :
                <script type="text/javascript">var RecaptchaOptions = {"theme":"clean","width":500,"height":300,"lang":"en"};</script>


                but when I use this : &recaptchaTheme=`red` the source change in :
                <script type="text/javascript">var RecaptchaOptions = {"theme":"red","width":500,"height":300,"lang":"en"};</script>
                  • 28449
                  • 8 Posts
                  No working solutions for this?
                  because I would like to have the recaptcha translated ...
                    • 41086
                    • 7 Posts
                    Maybe a tiny little late but my working solution looks like this:
                    [[!FormIt? 
                    &hooks=`recaptcha,email,redirect` 
                    &recaptchaTheme=`clean` 
                    &recaptchaWidth=`42` 
                    &recaptchaHeight=`23`
                    ...
                    ]]

                    The resulting HTML code looks like this:
                    <script type="text/javascript">var RecaptchaOptions = {"theme":"clean","width":"42","height":"23","lang":"de"};</script>

                    As you can see &recaptchaWidth -> width, &recaptchaHeight -> height.
                    But width and height actually do not have an influence on the the look of the recaptcha. [ed. note: mathis last edited this post 11 years ago.]