Calling menu in a certain way from page.tpl.php My menu structure looks like the structure in the left part of the image. I want the output to look like the right part of the image when I'm in the 'oranges' page for example. This works great if done from Drupal's admin panel, but is there any way I can code it in my page.tpl.php?



Currently, I'm using the code below to output my menu, but I can't seem to get it to look exactly the way I want. 

&lt;?php
  $main_menu = menu_navigation_links('main-menu', 2);
  print theme('links', array(
  'links' =&gt; $main_menu,
  'attributes' =&gt; array(
  'id' =&gt; 'main-menu',
  'class' =&gt; array('links', 'clearfix'),

),

  'heading' =&gt; array(
  'text' =&gt; t('Main menu'),
  'level' =&gt; 'h2',
  'class' =&gt; array('element-invisible'),
),
));
?&gt;


Any ideas?
You can use menu_tree_all_data function to get all nested menus. And then you can add your own html to display menus with your style

$menutree_produce = menu_tree_all_data('menu-produce');


And if you want to Active current menu on related page you can use menu_get_item and menu_set_item on that page 

$menu_item = menu_get_item(drupal_get_normal_path('produce/oranges'));
menu_set_item(NULL, $menu_item);