Get the current category name in Magento

A key part of the request execution has information stored into the Mage registry and accessing this information is a simple call requesting the needed data.  Learn how to access the registry to find the current category title.

The registry object we are interested in is ‘current_category’ and we will utilise the registry call getName() to create call to retrieve the needed information thusly;

Mage::registry('current_category')->getName();

src: http://www.magento-tutorial.com/

6 Comments

AK  on February 7th, 2010

100

Thanks.i was doing using loop but your solution is perfect.

DetZee  on May 9th, 2010

208

Thanks so much! :)

nullpointer  on September 3rd, 2010

228

Thanks…

Lalit  on November 11th, 2010

253

Thanks….
But i wamt hyperlink of that category also.

anunay  on November 11th, 2010

254

Try the code below, this should work:

Mage::registry('current_category')->getUrl();

dbaik  on January 31st, 2011

263

this is the easiest and correct way. thanx

Leave a Comment

*

Spam protection by WP Captcha-Free