Magento Expert Forum - Improve your Magento experience
-
URL key of a category in Magento
How can I get the URL key of a category in Magento. I have added this text in URL key field -
This is the code which I am trying -
$_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; ?>
My output is showing like this -
<a href="">
<span>Manual Tile Cutters</span>
</a>
View more threads in the same category:
- buy registered drivers license online(legitcleandocs.com)passport,IELTS certific
- Buy Passport,Driver License,Age & ID Card,(Whatsapp:.......: +1 (551) 239-2904) Visas
- Buy Passport,Driver License,Age & ID Card,(Whatsapp:.......: +1 (551) 239-2904) Visas
- Buy Passport,Driver License,Age & ID Card,(Whatsapp:.......: +1 (551) 239-2904) Visas
- Buy Passport,Driver License,Age & ID Card,(Whatsapp:.......: +1 (551) 239-2904) Visas
- Buy Passport,Driver License,Age & ID Card,(Whatsapp:.......: +1 (551) 239-2904) Visas
- buy real passports online(https://legitcleandocs.com)drivers license, visa, id card
- BUY UNDETECTABLE GRADE A+ COUNTERFEIT BANKNOTE(legitcleandocs.com)
- BUY REGISTERED DRIVERS LICENSE ONLINE https://worldpassporte.com/
- buy real registered drivers license online(legitcleandocs.com)visa, id card, resident
-
-
Junior Member
Try this, let me know for the further help.
Mage::getModel('catalog/category')->loadByAttribute('url_key', 'the-key-goes-here');
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks