title: Extending this code to open magento subcategories (vertical navigation)
body: <p>Hey guys, I'm wondering if anyone can help me extend this bit of code-</p>
  
  <pre><code>&lt;h3&gt;Browse by Category:&lt;/h3&gt;
  
  &lt;ul&gt;
  &lt;?php
  $obj = new Mage_Catalog_Block_Navigation();
  $store_cats = $obj-&gt;getStoreCategories();
  $current_cat    = $obj-&gt;getCurrentCategory();
  
  $current_cat    = (is_object($current_cat) ? $current_cat-&gt;getName() : '');
  
  foreach ($store_cats as $cat) {
          if ($cat-&gt;getName() == $current_cat) {
          echo '&lt;li&gt;&lt;a href="'.$this-&gt;getCategoryUrl($cat).'"&gt;'.$cat-&gt;getName()."&lt;/a&gt;&lt;ul&gt;";
          foreach ($obj-&gt;getCurrentChildCategories() as $subcat) {
              echo '&lt;li&gt;&lt;a href="'.$this-&gt;getCategoryUrl($subcat).'"&gt;'.$subcat-&gt;getName()."&lt;/a&gt;&lt;/li&gt;";
          }
          echo "&lt;/ul&gt;&lt;/li&gt;";
      } else {
          echo '&lt;li&gt;&lt;a href="'.$this-&gt;getCategoryUrl($cat).'"&gt;'.$cat-&gt;getName()."&lt;/a&gt;&lt;/li&gt;";
      }
  }
  ?&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Currently, this opens the subcats on a new page upon clicking(which is good). I have subcats inside subcats, but those never show up.(on the second page)</p>
  
  <p>So This is as far as I'll get-</p>
  
  <pre><code>Parent  
  -sub  
  Parent  
  -sub  
  </code></pre>
  
  <p>But I need :</p>
  
  <pre><code>Parent  
  -sub  
  ---sub  
  ---sub  
  ---sub  
  -sub  
  ---sub  
  ---sub  
  ---sub  
  </code></pre>
  
  <p>Can anyone help? :)</p>