We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7557
    • 61 Posts
    Hi.
    Many times with getResources I need simple chunk. I cant use @INLINE because modx process tags immediately and I get unexpected results.
    I wrote this simple snippet + chunk for resolve that problem.
    Snippet (InlineTplParser)
    if(!$input) return;
      $input = str_replace('{~', '[[', $input);
      $input = str_replace('~}', ']]', $input);
      return $input;

    Chunk (InlineChunk)
    [[+InlineTpl:InlineTplParser]]


    And call getResources like this:
    [[!getResources?
    &parents=`105` 
    &depth=`2` 
    &limit=`18` 
    &includeTVs=`1` 
    &tpl=`InlineChunk`
    &InlineTpl=`<p>{~+introtext~}</p><a href="{~~{~+id~}~}">{~+pagetitle~}</a>`
    ]]