We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14404
    • 84 Posts
    Quote from: Bruno17 at Apr 24, 2014, 11:24 PM
    I think the easiest way is to create a MODX - lexicon-entry for contact in each language
    and use lexicon - tags (uncached!):

    [[!%contact]]

    Thanks!

    [[!%contact? &language=`[[++cultureKey]]`]] 


    This works like a charm!
      • 4172
      • 5,888 Posts
      should work without
      &language=`[[++cultureKey]]`
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 14404
        • 84 Posts
        Quote from: Bruno17 at Apr 25, 2014, 02:19 AM
        should work without
        &language=`[[++cultureKey]]`
        You're right. For some reason it didn't work in the first place. Guess i made a mistake haha. Thanks a lot!
          • 26903
          • 1,336 Posts
          I have another problem, inside a form I have a placeholder thus [[+previewLink]].

          If I set this using $modx->setPlaceholder it has no effect, ie it doesn't set. it seems to retain its old value, unless I clear the site cache. I've tried the $cache parameter set to 0, no effect. I've also tried this syntax [![!+previewLink]] and this one [[!+previewLink]] to no avail.

          How do I set placeholders in these cached forms so it works every time?
            Use MODx, or the cat gets it!
            • 4172
            • 5,888 Posts
            I have my contactForm in an absolute uncached chunk

            [![!$contactForm]]


            inside that chunk

            [[!FormIt?
               &hooks=`spam,addAttachement,email`
               &emailTpl=`emailKontakt`
               &emailTo=`[email protected]`
               &emailUseFieldForSubject=`1`
               &validate=`name:required,
                  email:email:required,
                  subject:required,
                  text:required:stripTags`
            ]]
            
            [[!placeholdertest]]
            
            [[!+placeholdertest]]
            
            <form action="[[~[[*id]]]]" method="post" class="form">
                <input type="hidden" name="nospam:blank" value="" />
            
                <div class="form-group">
                <label for="name">
                    Name:
                </label>
                <input type="text" class="form-control" name="name" id="name" value="[[!+fi.name]]" />
                <span class="error">[[!+fi.error.name]]</span> 
            .
            .
            .
            .
            
            


            the snippet placeholdertest is

            $modx->setPlaceholder('placeholdertest',$_REQUEST['email']);


            the mmlCache - snippet runs in cache-modus (&cache=`1`)

            seems do work without issues.

            what is your whole scenario?
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 26903
              • 1,336 Posts
              Yes, I have one place holder outside of the form like yours and it works, its the two that are inside the form like so

              <input id="storyFormPreviewLink" name="storyFormPreviewLink" type="hidden" value="[[+previewLink]]" />

              that dont work.

              If I set these on page entry in a snippet it works, if I then comment out the setting in the snippet and refresh the page you would expect the values to return to 'value=' ie not set, in fact they don't they appear with the values as previously set by the snippet, as though the snippet was still setting them, if you clear the site cache and refresh the page it works, i.e. they adopt the values expected.

              Try moving your place holders above inside the form.

                Use MODx, or the cat gets it!
                • 36549
                • 572 Posts
                Hi,
                I'm having trouble getting pagination to work and wonder if it's something to do with the mml_cache setting?
                I have the following call:
                [![!getPage?
                &elementClass=`modSnippet`
                &element=`dw_getStoryResources`
                &parents=`39`
                &tpl=`storyItemListTpl`
                &includeContent=`1`
                &includeTVs=`1`
                &processTVs=`1`
                &showHidden=`1`
                &hideContainers=`1`
                &limit=`12`]]


                If i change the &limit to a much higher number (eg. 70 +) then the items display but setting this to 12 doesn't display anything. Any ideas?
                Thanks
                J
                  www.9thwave.co.uk
                     WEB | DESIGN | PRINT
                  • 4172
                  • 5,888 Posts
                  I don't know what your dw_getStoryResources - snippet does.

                  Just tested this:

                  [[!pdoPage?
                      &element=`pdoResources`
                      &parents=`58`
                      &loadModels=`migxmultilang`
                      &prepareSnippet = `mmlTranslatePdoToolsRow`
                      &includeTVs=`mml_pagetitle`
                      &prepareTVs=`1` 
                      &tpl=`testTpl`
                      &limit=`2`
                  ]]


                  my chunk testTpl is just:

                  <li>[[+pagetitle]]</li>


                  this is working and translating without issues

                  As recommended, you should allways try to use the pdoTools - snippets
                  with

                      
                  &loadModels=`migxmultilang`
                  &prepareSnippet = `mmlTranslatePdoToolsRow`
                  


                  if you want translated results
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 26903
                    • 1,336 Posts
                    dw_getStoryResources is just a copy of the standard getResources snippet with extra filtering so its getPage compatible , your example above uses pdoPage, not getPage, we use a standard getPage call thus :-

                    [![!getPage?
                    &elementClass=`modSnippet`
                    &element=`dw_getStoryResources`
                    &parents=`39`
                    &tpl=`storyItemListTpl`
                    &includeContent=`1`
                    &includeTVs=`1`
                    &processTVs=`1`
                    &showHidden=`1`
                    &hideContainers=`1`
                    &limit=`140`]]

                    are you saying this won't work with the mml stuff.
                      Use MODx, or the cat gets it!
                      • 4172
                      • 5,888 Posts
                      I didn't try to work with getPage and getResources inside mmlCache.

                      It should work, but it wouldn't translate anything, because getResouces doesn't know anything about the translated fields.
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!