title: Category tree from specific parent category
body: <p>With the code below I try to get the children categories from a specific parent category with ID 7.</p>
  
  <pre><code>&lt;?php
      $rootCatId = Mage::app()-&gt;getStore()-&gt;getRootCategoryId();
  
      function getTreeCategories($parentId, $isChild){
          $allCats = Mage::getModel('catalog/category')-&gt;getCollection()
                      -&gt;addAttributeToSelect('*')
                      -&gt;addAttributeToFilter('is_active','1')
                      -&gt;addAttributeToFilter('include_in_menu','1')
                      -&gt;addAttributeToFilter('parent_id',array('eq' =&gt; $parentId));
  
          $class = ($isChild) ? "sub-cat-list" : "cat-list";
          $html .= '&lt;ul class="'.$class.'"&gt;';
          foreach($allCats as $category)
          {
              $html .= '&lt;li&gt;'.$category-&gt;getName()."";
              $subcats = $category-&gt;getChildren();
              if($subcats != ''){
                  $html .= getTreeCategories($category-&gt;getId(), true);
              }
              $html .= '&lt;/li&gt;';
          }
          $html .= '&lt;/ul&gt;';
          return $html;
      }
      $catlistHtml = getTreeCategories($rootCatId, false);
  
      echo $catlistHtml;
  
  ?&gt;
  </code></pre>
  
  <p>With this code all categories shown. How I can get this tree only from the specific category with ID 7?</p>
  
  <p>Michael</p>