Only top level menu

edited June 2013 in Modules
Hi all,

I'm still creating my first FUEL website, I used several fuel_nav possibilities now, but I'm searching for a method to show only top level menuitems.

I'm using the 'side menu' successful with the parent option. Is there a possibility for my main menu to show only the top level (no children).

I know I can create groups in the CMS an associate a navigation menu to a group. But as I'm using the side menu with the parent option, I would love the possibility to show only the main parents in the main menu, all in the same group.

(a little bit fuzzy English, sorry about that).

Comments

  • edited June 2013
    Use the depth parameter like this:
    <?=fuel_nav(array('depth' => 0))?>
  • edited 5:32PM
    Thanks! Hmm, so easy. Strange I didn't see it.
    On remark: On this page (http://www.getfuelcms.com/user_guide/libraries/menu) it says 0 is default. But when I set depth => 0 it works as suspected. When I don't set it, I see all levels. So 0 is not the default value for depth.
  • edited 5:32PM
    I discovered a bug today... When I use depth=>0 for the main menu, it get's messy when I surf to a page which is two levels deeper.

    For example:
    -page 1
    -- page 1.1
    -page 2
    -- page 2.2
    - page 3.

    On the top level pages, the main menu works, on page 1.1 and page 2.2. I get to see the complete menu (with children). I'm not able to search for the cause of this, I will get back to this when I know more.
  • edited 5:32PM
    When you say messy what do you mean?
  • edited June 2013
    Messy, because it messed up my design. But this was the solution, again simple:
    <?php echo fuel_nav(array('container_tag_id' => 'mainmenu', 'depth' => 0, 'parent_id' => '0')); ?>

    I really start to love FUEL CMS, only a good image editor / manager is missing. But if I have spare time, I'll try to make a module for that.
Sign In or Register to comment.