04-28-2019, 08:27 PM
I wanted to change the menu for all menu-items left and all user function on right.
So I changed the file : dbnav.php in the user template directory
In function : customItemString() starting at line 6.
All menu-items from db with a display-order>=10000 will be right aligned based on following setting:
else {
// THIS is a typical menu link. What do you want it to look like?
// Note that this is in here twice to deal with if the link has http in it for a link to another website
$fix = $menuItem['link'];
if(substr($fix,0,4) == "http"){$e = 1;}else{$e=0;}
if($e == 1){
//It works the same for bootstrap 3 and 4 by default, but yourt template might want something other than li tags
$itemString.='<li class="nav-item"><a class="nav-link" href="'.$menuItem['link'].'"><span class="'.$menuItem['icon_class'].'"></span> '.$menuItem['display_order'].' '.$menuItem['label'].'</a></li>';
}else{
if ($menuItem['display_order']==10000){ $itemString.='</ul><ul class="navbar-nav ml-auto">'; }
$itemString.='<li class="nav-item"><a class="nav-link" href="'.US_URL_ROOT.$menuItem['link'].'"><span class="'.$menuItem['icon_class'].'"></span> '.$menuItem['label'].'</a></li>';
}
}
So I changed the file : dbnav.php in the user template directory
In function : customItemString() starting at line 6.
All menu-items from db with a display-order>=10000 will be right aligned based on following setting:
else {
// THIS is a typical menu link. What do you want it to look like?
// Note that this is in here twice to deal with if the link has http in it for a link to another website
$fix = $menuItem['link'];
if(substr($fix,0,4) == "http"){$e = 1;}else{$e=0;}
if($e == 1){
//It works the same for bootstrap 3 and 4 by default, but yourt template might want something other than li tags
$itemString.='<li class="nav-item"><a class="nav-link" href="'.$menuItem['link'].'"><span class="'.$menuItem['icon_class'].'"></span> '.$menuItem['display_order'].' '.$menuItem['label'].'</a></li>';
}else{
if ($menuItem['display_order']==10000){ $itemString.='</ul><ul class="navbar-nav ml-auto">'; }
$itemString.='<li class="nav-item"><a class="nav-link" href="'.US_URL_ROOT.$menuItem['link'].'"><span class="'.$menuItem['icon_class'].'"></span> '.$menuItem['label'].'</a></li>';
}
}