title: Magento custom links get active set
body: <p>Hi I am trying to get the active state for my foreach loop for my magento site.
  I have have tried everything, but it just wont work.. here is my code:</p>
  
  <pre><code>ksort($catArr);
  
  
  foreach($catArr as $postion=&gt;$catId){
  $_category = Mage::getModel("catalog/category")-&gt;load($catId);
  ?&gt;
  &lt;?php
  if($_category-&gt;getIsActive() )
  {
  $caturl = $_category-&gt;getURL();
  $catname = $_category-&gt;getName();
  ?&gt;
  
  &lt;?php if($_category-&gt;getdata('left_menu')): ?&gt;
  
  &lt;a  href="&lt;?php echo "$caturl" ?&gt;" &gt; &lt;li class="leftnav" &gt;&lt;div class="nav-name"&gt;
  &lt;?php echo $catname ?&gt;&lt;/div&gt;&lt;/li&gt;&lt;/a&gt;
  &lt;?php endif ?&gt;
  &lt;?php 
  }
  ?&gt;
  &lt;?php 
  }
  ?&gt;
  &lt;/ul&gt;
  &lt;/div&gt;
  &lt;?php endif ?&gt;
  </code></pre>