The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once



UserSpice
Split menu items (left & right sorting) - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28)
+--- Forum: Modifications and Hackery (https://userspice.com/forums/forumdisplay.php?fid=29)
+--- Thread: Split menu items (left & right sorting) (/showthread.php?tid=1457)



Split menu items (left & right sorting) - PeterAarts - 04-28-2019

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>';
}
}


RE: Split menu items (left & right sorting) - Brandin - 04-29-2019

Thanks for sharing!