Magento 2 – How to identify current page in phtml file? $currentFullAction = $block->getRequest()->getFullActionName(); $catpages= array('catalog_category_view','catalog_product_view'); if(in_array($currentFullAction, $catpages)){ //Catalog page } Tags Magento2 magento phtml