We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    Quote from: PatrickSamphire at Jul 03, 2007, 10:25 AM

    How exactly would you use that? Would you simply put it into the while loop, like this:
    while($row=$modx->fetchRow($rs)) {
       $output .= $modx->parseChunk('myTpl', $modx->placeholders, '[+', '+]');
    }

    Or is it more complicated than that?
    Nope, simple as that, though you need to set your placeholders on each loop. I was just trying to show that you can use any associative array as the replacement variables.
    while($row=$modx->fetchRow($rs)) {
       $modx->placeholders= array_merge($modx->placeholders, $row); // merge the row values into global placeholders
       $output .= $modx->parseChunk('myTpl', $modx->placeholders, '[+', '+]');
    }



    Quote from: heliotrope at Jul 03, 2007, 10:02 AM

    but If you want to use file system to store your chunk you cannot use this one(parseChunk).
    Storing it on the file system would mean it’s not a chunk, cause those are by definition stored in the DB. When the core changes for 0.9.7 are introduced, you will be able to provide a "chunk"-like content element and define the content as a simple path to a file on the file system to accomplish this and have the core parsing logic applied consistently.
      • 22770
      • 285 Posts
      Thanks, Jason. I’ll try that out.
        • 34017
        • 898 Posts
        The parsechunk is a great function. Is it documented anywhere on the site (I missed it if so).

        Chuck
          Chuck the Trukk
          ProWebscape.com :: Nashville-WebDesign.com
          - - - - - - - -
          What are TV's? Here's some info below.
          http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
          http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
          • 7923
          • 4,213 Posts
          Quote from: ProWebscape at Jul 03, 2007, 01:47 PM

          The parsechunk is a great function. Is it documented anywhere on the site (I missed it if so).

          Chuck

          http://wiki.modxcms.com/index.php/API:parseChunk


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 22770
            • 285 Posts
            Quote from: doze at Jul 03, 2007, 08:27 PM


            http://wiki.modxcms.com/index.php/API:parseChunk

            I must admit I looked at that and didn’t understand it. Would anyone who can understand it be willing to update the wiki with more detail? smiley