title: Drupal module nested menu items
body: <p>In implementing <a href="http://api.drupal.org/api/function/hook_menu" rel="nofollow noreferrer">hook_menu</a> for a module, I am trying to put some items into a submenu.</p>
  
  <p>So far I have something like this</p>
  
  <pre><code>$items['MyModule'] = array(
    //...
    'page callback' =&gt; 'system_admin_menu_block_page',
    'file' =&gt; 'system.admin.inc',
    'file path' =&gt; drupal_get_path('module','system'),
  );
  
  $items['MyModule/MenuItem1'] = array(
    //...
  );
  
  $items['MyModule/SubMenu'] = array(
    //...
    'page callback' =&gt; 'system_admin_menu_block_page',
    'file' =&gt; 'system.admin.inc',
    'file path' =&gt; drupal_get_path('module','system'),
  );
  
  $items['MyModule/SubMenu/SubMenuItem1'] = array(
    //...
  );
  </code></pre>
  
  <p>I expect the <code>SubMenu</code> to appear as, well, a submenu to the <code>MyModule</code> menu, and for the <code>SubMenuItems</code> to appear under that submenu. This is the default behaviour described at the <a href="http://api.drupal.org/api/group/menu" rel="nofollow noreferrer">Drupal API</a> documentation.</p>
  
  <ul>
  <li>MyModule
  
  <ul>
  <li>MenuItem1</li>
  <li>SubMenu
  
  <ul>
  <li>SubMenuItem1</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>However, all items appear under the <code>MyModule</code> menu.</p>
  
  <ul>
  <li>MyModule
  
  <ul>
  <li>MenuItem1</li>
  <li>SubMenuItem1</li>
  <li>SubMenu</li>
  </ul></li>
  </ul>
  
  <p>What am I doing wrong?</p>
  
  <p>*EDIT: A typo (which I have fixed) caused <code>SubMenu</code> to be a separate element rather than a child element of <code>MyModule</code>. I still don't understand why <code>SubMenuItem1</code> does not render under the <code>SubMenu</code>, though.</p>