Is there any methods to know which type of page i have with an url ?

I would like to know with a page .html if it s a product page , a category page , cms page or home ? And i would like to know also what is the productid, the categoryid, or the cms page id associate to the html url :)

Thanks a lot by advance



1 Answer 1


check product page and category page

        $product = Mage::registry('current_product');
        $id = $product->getId();

      $category = Mage::registry('current_category');  
  • @KeyurShah bro it was yesterday ,I enjoyed a lot with friends Commented Jan 15, 2018 at 14:31
  • Thanks Murtuza but i can t do that , indeed i will just send by ajax the url. So there is no current_.... :( Commented Jan 15, 2018 at 14:31
  • @thomaspoidevin can able to get Handlers ?? via this code var_dump(Mage::app()->getLayout()->getUpdate()->getHandles()); Commented Jan 15, 2018 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.