To throw in another idea, this is my modded DropMenu (see it live on my site www.theess.com).
If you call it like this
[tt][!DropMenu? &startDoc=`0` &levelLimit=`1`!][/tt]
it will only show top-level entries, and all entries in the active path. Say we call the top-level 0, and you clicked on an item that is a folder, than its contents (level 1) will be displayed too. If you then click on a level 1 entry, its contents (level 2) and its parents contents and the top-level items will be displayed. Hard to explain. Anyways, here’s the code:
Replace this:
// it's a document inside a folder
else
{
$itm .= ($child['alias'] > '0' && !$selfAsLink && ($child['id'] == $modx->documentIdentifier)) ? $child[$textOfLinks] : '<a href="[~'.$child['id'].'~]" title="'.$child[$titleOfLinks].'">'.$child[$textOfLinks].'</a>';
$itm .= ($debugMode) ? ' doc' : '';
}
$itm .= ($debugMode)? "$useCategoryFolders $isFolder $itsEmpty" : '';
// loop back through if the doc is a folder and has not reached the max levels
if ($isFolder && (($maxLevels == 0) || ($maxLevels > $listLevel + 1))) {
$itm .= MakeMap($modx, $child['id'], $listLevel +1, $description, $titleOfLinks, $maxLevels, true, $pre, $post, $selfAsLink, $ie, $activeLinkIDs, $topdiv, $topdivClass, $topnavClass, $subdiv, $subdivClass, $subnavClass, $hereClass, $useCategoryFolders, $categoryClass, $showDescription, $descriptionField, $textOfLinks, $orderBy, $orderDesc, $debugMode);
}
With this:
// it's a document inside a folder
else
{
$itm .= ($child['alias'] > '0' && !$selfAsLink && ($child['id'] == $modx->documentIdentifier)) ? $child[$textOfLinks] : '<a href="[~'.$child['id'].'~]" title="'.$child[$titleOfLinks].'">'.$child[$textOfLinks].'</a>';
$itm .= ($debugMode) ? ' doc' : '';
}
$itm .= ($debugMode)? "$useCategoryFolders $isFolder $itsEmpty" : '';
// check if the doc is active
$activeItem = false;
if (is_array($activeLinkIDs)) {
if (in_array($child['id'], $activeLinkIDs)) {
$activeItem = true;
}
}
// loop back through if the doc is a folder and has not reached the max levels, or if the doc is active
if ($isFolder && (($maxLevels == 0) || ($maxLevels > $listLevel + 1)
|| ($child['id'] == $modx->documentIdentifier) || ($activeItem == true))) {
$itm .= MakeMap($modx, $child['id'], $listLevel +1, $description, $titleOfLinks, $maxLevels, true, $pre, $post, $selfAsLink, $ie, $activeLinkIDs, $topdiv, $topdivClass, $topnavClass, $subdiv, $subdivClass, $subnavClass, $hereClass, $useCategoryFolders, $categoryClass, $showDescription, $descriptionField, $textOfLinks, $orderBy, $orderDesc, $debugMode);
}