We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37971
    • 14 Posts
    When I'd use getResources add-on one thing wich stuck develope process — you can't ignore node, only specific pages. My solution can help you with this.

    Open snippet getResources and replace (at 265 line):
        foreach ($resources as $resource) {

    on
        $exclude_node = array();
        foreach ($resources as $resource) {
            if (strpos($resource,'*')) {
                $exclude_node[] = abs(str_replace('*','',$resource));
                continue;
            }
    


    Add after (at line 371):
    foreach ($collection as $resourceId => $resource) {
    

    this code:
        if (!empty($exclude_node)) {
            $parentIds = $modx->getParentIds($resource->get('id'));
            $temp = array_intersect ($parentIds, $exclude_node);
            if (!empty($temp)) continue;
        }
    


    Now you can use snippet call with '*' after Id:
    [[!getResources:default=`No results found`? &parents=`0` &resources=`-10,-20*` &tpl=`Template`]]
    

    and snippet exclude document #10, #20 and all childs of #20.
      • 19328
      • 433 Posts
      Thanks, works perfectly for excluding children!
      • Great! Thank you! this was exactly what I needed!