Last active
September 4, 2018 15:45
-
-
Save tiagones/19c42c34120968564218f58c14d5667d to your computer and use it in GitHub Desktop.
Get and print the page type of a Magento page layout.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Identify the page type | |
$pageIdentifier = Mage::app()->getFrontController()->getAction()->getFullActionName(); | |
echo $pageIdentifier; | |
?> | |
<!-- Do something if on the specific page you need --> | |
<?php if(Mage::getBlockSingleton('page/html_header')->getIsHomePage()): ?> | |
home page | |
<?php elseif(Mage::app()->getRequest()->getRouteName()=='cms'): ?> | |
cms page | |
<?php elseif($this->getRequest()->getControllerName()=='product'): ?> | |
product page | |
<?php elseif($this->getRequest()->getControllerName()=='category'): ?> | |
category page | |
<?php elseif(Mage::app()->getRequest()->getRouteName()=='checkout'): ?> | |
checkout page | |
<?php elseif(Mage::app()->getRequest()->getRouteName()=='onestepcheckout'): ?> | |
onestepcheckout page | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment