I need to get the current page id and current module in Magento.
I used the code below.
Mage::app()->getRequest()->getModuleName() - To get current module. Mage::getSingleton('cms/page')->getIdentifier() - To get current page
As a result, he will clear the magento cache, otherwise he will show the old page and module.
Example:
When we register on the home page, it gives "cms" as a module and "home" as a page. Now I click on the page "Contacts" and now it shows the same result.
After clearing the cache and checking the contact page, it displays "cms" as modle and "contact" as the page identifier.
How to get the current page id and module without a transparent cache every time?
magento
Sankar subburaj
source share