We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22775
    • 15 Posts
    Hello
    I'm trying now for days to get FormIt to work together with migxMultiLang. I don't get it.
    The form in a Template without migxMultiLang is working, I checked that.

    What I have.
    - a snippet call with a cultureKey: [[!$contact-[[++cultureKey]]]]
    - a form for every language, here the german one in the chunk contact-de:
    [[!FormIt? &hooks=`spam,email,redirect` &emailTpl=`contactEmail-de` &emailTo=`customers-email-address` &redirectTo=`19`]]
    <p>[[!+fi.error.error_message]]</p>
    <form action="[[!~[[*id]]]]" method="post" class="form">
    <input type="hidden" name="nospam:blank" value="" />
    <br class="clear" />
    <label for="name">
    Name:
    </label>
    <input type="text" size="40" name="name:required" id="name" value="[[!+fi.name]]" /> [[!+fi.error.name]]
    <br class="clear" />
    <label for="email">
    E-Mail:
    </label>
    <input type="text" size="40" name="email:email:required" id="email" value="[[!+fi.email]]" /> [[!+fi.error.email]]
    <br class="clear" />
    <label for="betreff">
    Betreff:
    </label>
    <input type="text" size="40" name="betreff:required" id="betreff" value="[[!+fi.betreff]]" /> [[!+fi.error.betreff]]
    <br class="clear" />
    <label for="text">
    Text:
    </label>
    <textarea name="text:required:stripTags" id="text" cols="40" rows="5" value="[[!+fi.text]]">[[!+fi.text]]</textarea>
    <br class="clear" />
    [[!+formit.recaptcha_html]]
    [[!+fi.error.recaptcha]]
    <br class="clear" />
    <div id="button"><input type="submit" value="Senden" /></div>
    </form>


    The forms a now shown in the correct language in the fronted. But they don't work. Nothing happens.

    Any idea?
    Thanks in advance.
    Patrick

      • 4172
      • 5,888 Posts
      mmlCache does cache the complete result for each language.
      It does also process and cache normally uncachable tags.

      Everything inside mmlCache, which schouldn't be cached at all and processed later by MODX outside of mmlCache needs to be
      in tags like that:

      [![!FormIt? &hooks=`spam,email,redirect` &emailTpl=`contactEmail-de` &emailTo=`customers-email-address` &redirectTo=`19`]]
      <p>[![!+fi.error.error_message]]</p>
      <form action="[[~[[*id]]]]" method="post" class="form">
      <input type="hidden" name="nospam:blank" value="" />
      <br class="clear" />
      <label for="name">
      Name:
      </label>
      <input type="text" size="40" name="name:required" id="name" value="[![!+fi.name]]" /> [[!+fi.error.name]]
      <br class="clear" />
      <label for="email">
      E-Mail:
      </label>
      <input type="text" size="40" name="email:email:required" id="email" value="[![!+fi.email]]" /> [[!+fi.error.email]]
      <br class="clear" />
      <label for="betreff">
      Betreff:
      </label>
      <input type="text" size="40" name="betreff:required" id="betreff" value="[![!+fi.betreff]]" /> [[!+fi.error.betreff]]
      <br class="clear" />
      <label for="text">
      Text:
      </label>
      <textarea name="text:required:stripTags" id="text" cols="40" rows="5" value="[![!+fi.text]]">[[!+fi.text]]</textarea>
      <br class="clear" />
      [![!+formit.recaptcha_html]]
      [![!+fi.error.recaptcha]]
      <br class="clear" />
      <div id="button"><input type="submit" value="Senden" /></div>
      </form>
      


      You could also put this whole thing into a chunk and call only that chunk absolutely unchached
      For example:

      [![!$contact-[[++cultureKey]]]]


      then everything inside can be as usual.

      Btw.:
      Another way to translate forms, than using different chunks for each language is using the MODX - lexicon
      for Labels.




        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 22775
        • 15 Posts
        Thank you so much, works like a charm.