How do I get the URL key of a category in Magento. I have added this text in URL key field the CMS:
Category-1
This is how I'm currently trying to show my category URL in an anchor:
$_categories = Mage::getModel('catalog/category')->getCollection()
->addAttributeToSelect('name')
->addAttributeToSelect('is_active');
<?php foreach($_categories as $_category): ?>
<a href="<?php echo $_category->getCategoryUrl($_category); ?>">
<?php endforeach; ?>
But whenever I check my output it still shows like this:
<a href="">
<span>Manual Tile Cutters</span>
</a>
I have already checked google and the magento forums for this, but I still cannot find a sufficient answer.
Also, is what I'm trying to call in the anchor the URL key, or is it a different URL?