title: Magento get parent category and all his sub categories
body: <p>This is my category tree:</p>
  
  <pre><code>Cat_1 (This is the parent category with ID 4)
      Subcat_1
      Subcat_2
          Subsubcat_1
          Subsubcat_2
      Subcat_3
          Subsubcat_3
          Subsubcat_4
      Subcat_4
  </code></pre>
  
  <p>I tried this code to retrieve this category tree but i only came to the level of the subcats. I need one level deeper.</p>
  
  <pre><code>&lt;?php
  $cat = Mage::getModel('catalog/category')-&gt;load(4);
  $subcats = $cat-&gt;getChildren();
  
  foreach(explode(',',$subcats) as $subCatid)
  {
    $_category = Mage::getModel('catalog/category')-&gt;load($subCatid);
    if($_category-&gt;getIsActive()) {
      $sub_cat = Mage::getModel('catalog/category')-&gt;load($_category-&gt;getId());
      $sub_subcats = $sub_cat-&gt;getChildren();
      foreach(explode(',',$sub_subcats) as $sub_subCatid)
      {
            $_sub_category = Mage::getModel('catalog/category')-&gt;load($sub_subCatid);
            if($_sub_category-&gt;getIsActive()) {
                echo '&lt;li class="sub_cat"&gt;&lt;a href="'.$_sub_category-&gt;getURL().'" title="View the products for the "'.$_sub_category-&gt;getName().'" category"&gt;'.$_sub_category-&gt;getName().'&lt;/a&gt;&lt;/li&gt;';
            }
       }
    }
  }
  ?&gt;
  </code></pre>
  
  <p>Can someone help me?</p>