title: Sorting categories in Magento according to the position in admin
body: <p>I would like to know how to sort this list of categories (I followed this tutorial here <a href="http://www.devinrolsen.com/magento-custom-category-listing-block/" rel="noreferrer">http://www.devinrolsen.com/magento-custom-category-listing-block/</a>) in magento by position in the admin panel? Currently it is sorted by id</p>
  
  <pre><code>&lt;?php
  $cats = Mage::getModel('catalog/category')-&gt;load(3)-&gt;getChildren();
  $catIds = explode(',',$cats);
  ?&gt;
  &lt;ul&gt;
  &lt;?php foreach($catIds as $catId): ?&gt;
      &lt;li&gt;
          &lt;?php
              $category = Mage::getModel('catalog/category')-&gt;load($catId);
              echo '&lt;a href="' . $category-&gt;getUrl() . '"&gt;';
              echo $category-&gt;getName() . '&lt;/a&gt;';
          ?&gt;
      &lt;/li&gt;
  &lt;?php endforeach; ?&gt;
  &lt;/ul&gt;
  </code></pre>