I need to get Current page Identifier and current module in Magento.
I used the below code.
Mage::app()->getRequest()->getModuleName() - To get current module.
Mage::getSingleton('cms/page')->getIdentifier() - To get current page
Its working once clear the magento cache otherwise it shows the old page and module.
Example:
When we check in home page it gives ‘cms’ as module and ‘home’ as page.
Now I click the Contact page now also it shows same result.
After clear the cache and check the contact page it shows “cms” as modle and ‘contact’ as page Identifier.
How to get current page Identifier and module without clear cache every time?
To get current module:
To get current CMS page: