× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Split menu items (left & right sorting)
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>';
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>';

Attached Files Thumbnail(s)
Thanks for sharing!

Forum Jump:

Users browsing this thread: 1 Guest(s)