$template = $ditto->template->determine($templates, $x, 0, $stop, $resource[$x]["id"]); // choose the template to use and set the code of that template to the template variable $renderedOutput = $ditto->render($resource[$x], $template, $removeChunk, $dateSource, $dateFormat, $placeholders, $phx, abs($start - $x), $stop); // render the output using the correct template, in the correct format and language $modx->setPlaceholder($dittoID . "item[" . abs($start - $x) . "]", $renderedOutput); /* Placeholder: item[x] Content: Individual items rendered output */ $output .= $renderedOutput; // send the rendered output to the buffer } } else { $output .= $ditto->noResults($noResults, $paginate); // if no documents are found return a no documents found string } $output .= $footer; // send the footer // --------------------------------------------------- // Save Object // --------------------------------------------------- if ($save) { $modx->setPlaceholder($dittoID . "ditto_object", $ditto); $modx->setPlaceholder($dittoID . "ditto_resource", $save == "1" ? array_slice($resource, $display) : $resource); } } else { $output = $header . $ditto->noResults($noResults, $paginate) . $footer; } // ---------------------------------------------------