We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30100
    • 58 Posts
    dev_cw, sottwell, thank you so much for the help! The wrapper snippet did it, it’s now working! wink
      • 30100
      • 58 Posts
      I made a wrapper snippet for chunkListParser instead, now I can easily call all the snippets inside as usual cached or uncached. Again, thanks for the help.

      <?php
      //---Name--
      //chunkListParser_cached
      
      //---About---
      //This snippet was fastly created to be able to call the snippet chunkListParser cached to make it possible
      //to call snippets within the chunks inserted by chunkListParser uncached.
      
      //---Parameters---
      //This snippet is written to be used with one parameter, &chunks, where you put the name of the TV that you
      //would have used.
      //Ex. [[chunkListParser_cached? &chunks=`functions_sidebar`]]
      
      // identify the chunks
      $docid = $modx -> documentIdentifier;
      $chunks_result = $modx -> getTemplateVarOutput($chunks, $docid);
      
      // use the chunks in the chunkListParser call
      $snippet_output = $modx->runSnippet("chunkListParser", array(
      	"chunks" => $chunks_result[$chunks],
      	"wrapperdiv" => $chunks ));
      
      //debug (if something does not work, the line below shows the variable values)
      //$snippet_output = $snippet_output.", docid=".$docid.", chunks=".$chunks.", chunks_result[$chunks]=".$chunks_result[$chunks];
      
      // output the chunkListParser results
      return $snippet_output;
      ?>
      


      http://wiki.modxcms.com/index.php/Talk:Create_TV-Based_Chunks#Wrapper_snippet_to_call_chunkListParser_chached_to_make_it_possible_to_call_sub-snippets_unchached
        • 7231
        • 4,205 Posts
        Good show. I really like the wrapper snippet concept, you can do some cool stuff and keep the tags simple.
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don&#39;t know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 30100
          • 58 Posts
          Yes, it’s a great concept, and really easy to use to once you know the syntax for the run snippet function.