We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36804
    • 19 Posts
    I am building a panel where the backend user can choose (using MIGx) )from 6 layouts.

    I am then passing the json output into a snippet where i extract the IDs and then run getResources via runSnippet

    e.g.

    Snippet:
    $output = $modx->runSnippet('getResources', array(
     'resources' => $resourceIDs,
     'depth' => '1',
     'tpl' => 'tplWrapper',
     'toSeparatePlaceholders' => 'slot-'
    ));
    


    tplWrapper Chunk:
    [[+slot-0]]
    [[+slot-1]]
    [[+slot-2]]
    



    I am getting no output with this and have also tried it uncached and as straightforward snippet from a chunk.

    If I omit the tpl and placeholder I can see the array output so I know it's returning something.

    I tried a multi-columns example I found in the forum but it doesn't work for me,
    Can anyone point me to an example?

    thanks,

      • 36804
      • 19 Posts
      I did what I needed to using getCollection instead but I'd still like to see an example...
        • 22303 MODX Staff
        • 10,725 Posts
        I think the issue is because you are not specifying a parents property in your runSnippet call to getResources. In this case, parents will be set to the id of the current Resource on which the Snippet is being executed. If you only want the specific resources to be returned, you should specify a value of -1 for the parents property.