We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3232
    • 380 Posts
    I know I have seen this on the board before but just cannot find it.

    I am looking to use three different snippets. becuase of the current limitation of only using two snippet calls within each other [!...[[...]]...!] it makes it inpossible to use the thrid snippet I need.

    I want to create a custome snippet, is there a way i can call 3 different snippets inside of another snippet??

    Thanks
    Brian
      • 29181
      • 480 Posts
      Hi,
      I’m doing something similar atm. I have a snippet that has to check some stuff, call UltimateParent (or something very similar) and then wayfinder...you can do it like this:

      <?php
      $runWayf=$modx->runSnippet(
      'Wayfinder',
      array(
      startId=>'1',
      rowTpl=>'tertTpl',
      outerTpl=>'tertTplOuter',
      ));
      ?>


      Taff
        Adrian Lawley: www.adrianlawley.com
        • 22303 MODX Staff
        • 10,725 Posts
        See $modx->runSnippet(string $name, Array $parameters);

        e.g.
        <?php
        $output= $modx->runSnippet('SnippetOne', array ('param1' => 'foo', 'param2' => 'bar'));
        $output.= $modx->runSnippet('SnippetTwo', array ('param1' => 're', 'param2' => 'bar'));
        $output.= $modx->runSnippet('SnippetThree', array ('param1' => 'chocolate', 'param2' => 'bar'));
        ?>
          • 3232
          • 380 Posts
          Thank you both!