We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    I’m in Belgium so, need to go sleep soon to. laugh

    Using right function etc.

    Just download template upload it,import template file in manager and changed some paths that’s it!
      • 18397
      • 3,250 Posts
      Here you go (from the TP3.2 download as it is no-longer included in the download)

      As to why dropmenu won’t work, that template was designed before x9 and so the styles don’t work the same.

      /*
       *	MenuBuilder 
       *	Builds the site menu
       *
       *	Modified by Raymond Irving July, 2005 
       *	- now supports menutitle and hidmenu
       *	
       *	Params:	&normclass	- normal item class (mouseout) 
       *			&selclass	- selected item class (active)
       *			&nosub		- no sublevel items
       *
       */
       
      
      if(!isset($id)) {
          $id = $modx->documentIdentifier; //current document
      }
      
      $nosub = isset($nosub) ? 1:0;
      
      $indentString="";
      
      if(!isset($indent)) {
          $indent = "";
          $indentString .= "";
      } else {
          for($in=0; $in<$indent; $in++) {
              $indentString .= " ";
          }
          $indentString .= "» ";
      }
      
      $children = $modx->getActiveChildren($id,'menuindex','ASC','id, pagetitle, description, parent, alias, menutitle, hidemenu'); 
      $menu = ""; 
      $childrenCount = count($children); 
      $active="";
      
      if($children==false) {
          return false;
      }
      for($x=0; $x<$childrenCount; $x++) {
      	if($children[$x]['hidemenu']!=1){ // check if we should hide/show menu
      		if($children[$x]['id']==$modx->documentIdentifier) {
      			$active = isset($selclass) ? "class='$selclass'":"class='highLight'";
      		} 
      		else {
      			$active="";
      			$active = isset($normclass) ? "class='$normclass'":"";
      		}
      
      		// use either menu or page title
      		$mnuTitle = $children[$x]['menutitle'] ? $children[$x]['menutitle']:$children[$x]['pagetitle'];
      		if($children[$x]['id']==$modx->documentIdentifier || $children[$x]['id']==$modx->documentObject['parent']) {
      			$menu .= "<a ".$active." href='[~".$children[$x]['id']."~]'>$indentString".$mnuTitle."</a>".($nosub ? "":"[[MenuBuilder?id=".$children[$x]['id']."&indent=2]]");
      		}
      		else {
      			$menu .= "<a href='[~".$children[$x]['id']."~]'>$indentString".$mnuTitle."</a>";
      		}
      	}
      }
      return $menu."";
      


        • 34162
        • 1 Posts
        Thx it works now! smiley

        Love MODx...

        This discussion is closed to further replies. Keep calm and carry on.