title: How to retrieve Categories name and children ? Magento
body: <p>I would like to retrieve the categories of my website in order to build me own Category menu.
  but I don't understand how to get all the categories from the class/model. So I've created a file called top.phtml that I've put in template/catalog/navigation , </p>
  
  <p>First, do I MUST put that name to the file into that folder if I want to create a top Menu ? Can t I decide where to put it with the name I want like TopMenu.phtml ? Because in evry tut I red, they are doing the same way ..</p>
  
  <p>Second : What i the function I must call ? I've been here : <a href="http://www.magentix.fr/ergonomie-web/agencer-page-accueil-site-magento.html" rel="nofollow">http://www.magentix.fr/ergonomie-web/agencer-page-accueil-site-magento.html</a> but the way the do that doesn t work for me .. I add that code to my file top.phtml properly called in the page.xml :</p>
  
  <pre><code>&lt;div class="category-list" style="background-color:white;"&gt;
  &lt;h2&gt;Nos produits&lt;/h2&gt;
  &lt;?php
      foreach ($this-&gt;getStoreCategories() as $_category):
              if($_category-&gt;getIsActive()):
                      $_category = Mage::getModel('catalog/category')-&gt;load($_category-&gt;getId());
                      $layer = Mage::getSingleton('catalog/layer')-&gt;setCurrentCategory($_category);
                      ?&gt;        
                           &lt;div class="category-list-view"&gt;
                                  &lt;a href="&lt;?php echo $this-&gt;getCategoryUrl($_category)?&gt;" title="&lt;?php echo $_category-&gt;getName()?&gt;"&gt;
                                         &lt;img src="&lt;?php echo $this-&gt;getCurrentCategory()-&gt;getImageUrl(); ?&gt;" alt="&lt;?php echo $_category-&gt;getName() ?&gt;" /&gt;
                                  &lt;/a&gt;
                                  &lt;h3&gt;&lt;a href="&lt;?php echo $this-&gt;getCategoryUrl($_category)?&gt;" class="name" title="&lt;?php echo $_category-&gt;getName()?&gt;"&gt;&lt;?php echo $_category-&gt;getName()?&gt;&lt;/a&gt;&lt;/h3&gt;
                           &lt;/div&gt;
                      &lt;?php
              endif;
      endforeach;
  ?&gt; 
  &lt;/div&gt;
  </code></pre>
  
  <p>Last : where could I find a clear user guide like there is for CodeIgniter ? I found that, but I never found any answer on it : <a href="http://www.magentocommerce.com/wiki/doc/webservices-api/api#magento_core_api" rel="nofollow">http://www.magentocommerce.com/wiki/doc/webservices-api/api#magento_core_api</a></p>
  
  <p>Thanks for your answers, I m a web dev used to work with CodeIgniter or without any template, and I can t clearly see the logic behind Magento way of programming.</p>
  
  <p>EDIT: Is there anything to do with the categories ? Becaue I tried to  create a sub category under the Default Category and it do work, but if I create a new Root Category,It simply didnt recognize it .. why </p>