We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29661
    • 116 Posts
    Hello,
    is it possible to call same snipet more times with different values of placeholders?

    I have now this code in snipet:

    $output = "";
    $modx->setPlaceholder(’pollHeader’, ’test2’);
    $output .= $modx->getChunk($chunkPoll);
    $modx->setPlaceholder(’pollHeader’, ’test3’);
    $output .= $modx->getChunk($chunkPoll);
    return $output;

    but i am getting chunk twice with test3 value...
      --
      John
      @theboxer
      • 29661
      • 116 Posts
      noone know how to do that?
        --
        John
        @theboxer
        • 4172
        • 5,888 Posts
        try that:

        <?php
        
        $output = "";
        $ph['pollHeader']='test2';
        $output .= $modx->parseChunk($chunkPoll,$ph,'[+','+]');
        $ph['pollHeader']='test3';
        $output .= $modx->parseChunk($chunkPoll,$ph,'[+','+]');
        return $output;
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 29661
          • 116 Posts
          it works, thx
            --
            John
            @theboxer