Retrieve current product, category and CMS page in Magento

Here are the quick snippet scripts for pulling out the current product, category and cms page from inside script or template files in Magento.

Get Current category

$_category = Mage::registry(‘current_category’);

Get Current Product

$_product = Mage::registry(‘current_product’);

Get Gurrent CMS Page

$_cmspage = Mage::registry(‘cms_page’)

Leave a Reply