We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26503
    • 620 Posts
    how do I include a snippet in another snippet? i.e.

    include("[[!mysnippet]]");

    -thanks
    -sean
      *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

      Sean Kimball CLP, CLS.
      Technical Director / Sr. Developer | BigBlock Studios
      ._______________________________________________.
      Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
      27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
      phone/fax: 905-426-5525
      • 3749
      • 24,544 Posts
      Quote from: sean69 at Jan 29, 2011, 01:58 PM

      how do I include a snippet in another snippet? i.e.

      include("[[!mysnippet]]");

      -thanks
      -sean

      <?php
      $params = array(
         'param1'=>'value1',
         'param2'=>'value2',
         //etc.
      );
      
      /* the second argument is optional */
      $snippetOutput = $modx->runSnippet('mysnippet', $params);
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting