We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13476
    • 8 Posts
    Hi all,


    Current menu structure

    Root > Event > Event Information
    Root > Other Events > Type of event > Event name


    I want the DropMenu to always show the whole of the tree from the 2nd level...

    Event Information
    -or-
    Type of event > Event name

    The problem is when you are in the "Event name" section - there’s no way of sidestepping.

    So far I came up with this:

    if ($modx->documentObject['id'] != $modx->config['site_start']) {
    
    $child = $modx->documentObject;
    
    while ( $child['parent'] != $modx->config['site_start'] ) {
      $child = $modx->getTemplateVars($child['parent']);
    }
    
    return $modx->runSnippet('DropMenu',array('startDoc'=>$child['id'], 'levelLimit'=>3));
    
    }
    


    But it doesn’t seem to want to work sad



    James
      • 13476
      • 8 Posts
      OOooo I just found UltimateParent - that will work!