We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32982
    • 674 Posts
    realy i want a plugin for all the snippets dont parsed but here are for only one
    $content = $modx->documentOutput;
    $parsedsnippet=$modx->runSnippet(’ContactForm’);
    $new = str_replace("[!ContactForm!]", $parsedsnippet, $content);
    $modx->documentOutput = $new;
      Jabiertxof (formerly XYZVISUAL)
      My bussines: http://marker.es
      https://www.youtube.com/user/jabiertxof/videos
      • 18397
      • 3,250 Posts
      Why would the parser not parse snippets normally?
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        I’ve had this happen to me a few times lately, when using eForm with its tags in a chunk, and using a snippet in the form template. If I juggle cached/unchached snippet calls it will work, but if I don’t get it right the form template will simply display the snippet tags in place of the value the snippet should return.

        I have a snippet that generates a dropdown select based on documents in a given folder:

        <tr>
          <th>Pages:</th>
          <td>[[MakeSelect?folderID=`51`]]</td>
        </tr>
        


        The page containing the form is not cached, the eForm call is contained in a chunk and is called with [[...]] syntax. If I call the MakeSelect snippet uncached, then the snippet tags will be displayed. If I call the eForm snippet directly from the page, this doesn’t happen.

        I’ve also gotten very odd displays of the snippet tags if I have spaces between the arguments both with eForm and with MaxiGallery, when called in a chunk. I say "odd" because both contain an &lang argument, and that argument gets turned into a <=`whatever`!
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 18436
          • 135 Posts
          I’ve encountered the same problem recently with cached/uncached calls to snippets within chunks, does your solution at the top of the page fix this?
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            As long as I have no spaces between the snippet arguments and try different snippet syntax I can always get them to work. I’m sure there is some logical explanation for all of this, but I just haven’t had the energy to go digging through the chunk and snippet parsing code in the parser.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 32982
              • 674 Posts
              for me use for import content whith snipets from other documents, hi
                Jabiertxof (formerly XYZVISUAL)
                My bussines: http://marker.es
                https://www.youtube.com/user/jabiertxof/videos