Menus - hard coded primary nav with per-page sub nav My primary navigation is hard coded (it has to be; graphical purposes).

Firstly, how can I tell which one is "active" (current page)?

Secondly, based upon which one is active, how can I show child links of that link in the sidebar? I've thought of a possibility, but it would require creating tons of blocks for the menus and then only enabling them on their parent page. This seems like a lot of work for something that a module should take care of.

I've found http://drupal.org/project/menu_block which looks promising, but I'm not clear how to use it in my situation.

I prefer to have total control of how the menus will look (a custom .tpl file)
I am not sure which part you need hardcoded, but if it is everything but the a tag, then then l() helper function comes to the rescue: 

&lt;li class="menu-item" id="foo"&gt;
  &lt;span&gt;
    &lt;img src="menu_foo.png" alt="icon showing foo"/&gt;
    &lt;?php print l("Foo", "original/path/to/foo") ?&gt;
  &lt;/span&gt;
&lt;/li&gt;


Now, if you access "/original/path/to/foo" or (on of its) alias(es), the l() helper will automatically add a class "active" to the a tag, generated by l().

If, for some reason you need the l() outside of the a, or if you want to customize the a itself (e.g. by adding markup to it), you can use the code seen in the l() to determine activeness  of the current item. Place this as helper in template.php of your theme:

function _my_theme_is_active($path) {
  $active = FALSE;
  if (($path == $_GET['q'] || ($path == '&lt;front&gt;' &amp;&amp; drupal_is_front_page())) &amp;&amp; 
      (empty($options['language']) || $options['language']-&gt;language == $language-&gt;language)) {
    $active = TRUE;
  }
  return $active;
}


Obviously my_theme is the name of your theme.

Then in the tpl.php files, or anywhere in the scope of your theme, you can use the function:

&lt;li&gt;
  &lt;a href="&lt;?php print url("original/path/to/foo") ?&gt;" &lt;?php print (_my_theme_is_active("original/path/to/foo") ? 'class="active"' : ' ') ?&gt; id="foo-1"&gt;
    Foo
  &lt;/a&gt;
&lt;/li&gt;


Beware that you use url() to catch aliasing for the oringial path, but that you /do/ pass in the original (system) path into the _my_theme_is_active helper.