Outputting main menu in full in page.tpl.php I'm using the code below to print my main menu in page.tpl.php:

&lt;?php
$main_menu = menu_navigation_links('main-menu');
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;


However, it is only outputting the top-level menus of my navigation. Is there a piece of code I can add that will output submenus too?
Calling menu_navigation_links() with only the menu name by default provides only the top level links.  To delve deeper you need to provide the second $level argument, eg:

$main_menu =menu_navigation_links('main-menu', 1);


will provide the top and next level links, and:

$main_menu =menu_navigation_links('main-menu', 2);


will provide one level deeper.