Three level menu: How to show only the children of the current page? A three level menu:

  Item 1
    Item A
        Item X
        Item Y
        Item Z
    Item B
        Item Xx
        Item Yx
        Item Zx
    Item C
        Item Xy


When viewing the "Item 1" node,  I'd like to display the sub-menu items in the template: Item A, Item B, Item C

When viewing the "Item B" node,  I'd like to display the sub-menu items in the template: Item Xx, Item Yx, Item Zx

While I would like to rely totally on the menu structure, the output will not be displayed as a traditional menu.

This code does what I need:

function subpages($nid=null) {

$nid = 'node/'.$nid;

$menuItems = menu_tree_page_data('main-menu'); 

foreach($menuItems as $key =&gt; $m) {
    if ($m['link']['in_active_trail'] &amp;&amp; $menuItems[$key]['below'] &amp;&amp; $m['link']['link_path']  == $nid) {  
        $menu = menu_tree_output($menuItems [$key]['below']);
        } else if ($m['link']['in_active_trail'] &amp;&amp; count($menuItems[$key]['below']) &gt; 0) {
            foreach ($menuItems[$key]['below'] as $k =&gt; $third) {
                if ($third['below'] &amp;&amp; $third['link']['in_active_trail']) {
                    $menu = menu_tree_output($third['below']);
                //foreach ($third['below'] as $item) {
                //  echo $item['link']['link_title'].'&lt;br&gt;';
                //}
            }
        }
    }
}
return $menu;


}
You can do that with Menu Block module.


  It provides configurable blocks of menu trees starting with any level of any menu. And more!


You can then first create a menu block in the block configuration page.  Then configure the menu block to start with the 2nd or 3rd level according to which level of the menu you want to have and set the depth to 1 so that it only lists that level and not its children. 

If you want to have sub-menu items follow the current menu item, i.e. it always shows the children of the current page, you should set under the menu block configuration, Advanced Options, and check Make the starting level follow the active menu item.