Filter menu by group

edited December 2015 in Feature Requests
Hello every body ! I have created two menu in the back office and i like to filter the display by group_id but it display all menu, 'top_menu' and 'side_menu',
echo fuel_nav(array('parent_id' => 'top_menu','container_tag_id' => 'side_menu', 'item_id_prefix' => 'side_menu_'));


  • edited 1:39AM
    Specify the 'group_id' => 'top_menu' like so:
    echo fuel_nav(array('parent_id' => 'top_menu', 'group_id' => 'top_menu', 'container_tag_id' => 'side_menu', 'item_id_prefix' => 'side_menu_'));
  • edited 1:39AM
    Thanks for your reply
    I use your code but it display again the two menu, i have downloaded the file nav.php from the dashboard and this is the content that i added in the nav.php in _variables

    $nav['top_menu'] = array('label' => 'Top Menu', 'location' => '');
    $nav['top_menu1'] = array('label' => 'Top menu 1', 'location' => '', 'parent_id' => 'top_menu');

    $nav['side_menu'] = array('label' => 'Side Menu', 'location' => '');
    $nav['side_menu1'] = array('label' => 'Side menu 1', 'location' => '', 'parent_id' => 'side_menu');

    where i make mistake
  • edited 1:39AM
    By default, the fuel_nav function will look for the $nav variable in the nav.php file. You can pass the "var" parameter to change this. So try the following:
    $nav2['side_menu'] = array('label' => 'Side Menu', 'location' => ''); $nav2['side_menu1'] = array('label' => 'Side menu 1', 'location' => '', 'parent_id' => 'side_menu');
    echo fuel_nav(array('parent_id' => 'top_menu', 'var' => 'nav2', 'container_tag_id' => 'side_menu', 'item_id_prefix' => 'side_menu_'));
  • edited 1:39AM
    It works, thank you very much
Sign In or Register to comment.