How do I sync taxonomy terms with the second level of a menu? This question pops every time I create a new e-commerce site.

I have a horizontal main menu with Home, Products, Blog, etc... in it. I need to get the terms from my Product catalogue as the drop down menu underneath Products.

I use Taxonomy Menu to good effect elsewhere in the site, but I can't see any way of moving an entire Taxonomy Menu (or even a sub-set) to underneath a menu link in another menu.

My usual method is to hard-code a function into my theme (with appropriate caching of course), which builds up the sub-menu of terms. I then have to create another function to mimic the menu rendering functions, and inject the 'taxonomy menu' when my loop hits a certain menu link ID. Finally I use that function in place of the standard method of outputting menu links in my page template file.

Needless to say that's not a good method and it leaves me feeling dirty every time. I'd really prefer a more opaque method that keeps the menu in sync when terms in the vocabulary are changed.

It seems like this problem would have been solved over and over again, but my Google-fu is failing me.

Anyone got any good suggestions (that don't involve creating a View, which would be way too much overhead)?

I should also mention the lazy man in me is looking for a pre-built module to do this. It would be fairly trivial(ish) to implement the code on a case-by-case basis (see hampusn's comment below) but I'm hoping there's a generic module based solution available.
I used this on a site a few months ago to essentially do the same thing:

function _foo_add_submenu ($menu_name, $vid, $plid)
{
  $vocabulary = taxonomy_vocabulary_load($vid);
  $tree = taxonomy_get_tree($vid);

  if (count($tree) &gt; 0) foreach ($tree as $term) {
    $item = array(
      "link_path" =&gt; "taxonomy/term/{$term-&gt;tid}",
      "link_title" =&gt; $term-&gt;name,
      "menu_name" =&gt; "menu-menu",
      "plid" =&gt; $plid,
      "router_path" =&gt; "taxonomy/term/%",
    );

    $sql = "
      SELECT menu_links.mlid
      FROM {menu_links} menu_links
      WHERE menu_name = :menu_name AND plid = :plid AND link_path = :link_path
    ";

    $result = db_query($sql, array(
      ":menu_name" =&gt; $menu_name,
      ":plid" =&gt; $plid,
      ":link_path" =&gt; $item["link_path"],
    ));

    $record = $result-&gt;fetchObject();  

    if (isset($record-&gt;mlid) &amp;&amp; $record-&gt;mlid &gt; 0) $item["mlid"] = (int) $record-&gt;mlid;

    menu_link_save($item);
  }

  menu_cache_clear_all();
}


$menu_name is the menu to mess with, $vid is the vocabulary to build from, and $plid is the item to add to.  When you run this, you will end up with a real menu in admin/structure/menu/manage/menu-whatever.  You will need to add some additional housekeeping functions to handle adding terms, removing terms, etc, but they all involve similar functions and menu_link_save / menu_link_delete and menu_cache_clear or menu_cache_clear_all being called from the right taxonomy hook.