You can add standard Ditto parameters by editing (or including) parameters to the runSnippet call:
// run ditto snippet
$output = $modx->runSnippet("Ditto", array(
"debug" => "0",
"parents" => $parents,
"depth" => "4",
"display" => $display,
"paginate" => "0",
"paginateAlwaysShowLinks" => "0",
"sortBy" => "pagetitle",
"sortDir" => "ASC",
"tpl" => $dittoTpl,
"filter" => $filter,
"tplPaginatePrevious" => "@CODE <li><a href='[+url+]'>Previous</a></li>\n",
"tplPaginateNext" => "@CODE <li><a href='[+url+]'>Next</a></li>\n",
"tplPaginateNextOff" => "@CODE <li><a href='[~[*id*]~]#'>Next</a></li>\n",
"tplPaginatePreviousOff" => "@CODE <li><a href='[~[*id*]~]#'>Previous</a></li>\n",
"tplPaginatePage" => "@CODE <li><a href='[+url+]'>[+page+]</a></li>\n",
"tplPaginateCurrentPage" => "@CODE <li class='selected'><a href='[~[*id*]~]#'>[+page+]</a></li>\n",
"seeThruUnpub" => "1" ));
You could set the parents as as unpublished and use the seeThruUnpub parameter to go into those documents to get the children without getting the parent. Untested, but it should work. If they need to be published we would need to set up additional filters for each parent...I don’t recall if Ditto has an exclude document parameter.
For the default option...edit this line at the top of the snippet which sets the filter to an empty string ’’:
$filterBy = isset($_GET["letter"]) ? strtoupper($_GET["letter"]) : "";
by adding a default letter if none is selected:
$filterBy = isset($_GET["letter"]) ? strtoupper($_GET["letter"]) : "A";
Let me know if this doesn’t work and I will do some testing to figure it out.