3

I have Added Custom page layout in my store.
And set Test Category Page But when I try to get my phtml file in category page

$request = $objectManager->get('Magento\Framework\App\Request\Http');
$layout = $request->getFullActionName();

It's catalog_category_view. I want there Test Category Page id which was I had set in Admin.

2

Page layout and handler are two different elements at Magento layout.

Payout is 1column,2 columns-left,2 columns-right,cutome_home.

Where

handler is cms_index_index.xml,catalog_product_view,default,catalog_category_view etc

In Magento2, a page layout element can be managed using Layout handler .

At Magento, a unique handler created basically on Full Action Name every page.

If you trying at .phtml file

then use

$block->getLayout()->getUpdate()->getPageLayout()

At BLock class use

$this->getLayout()->getUpdate()->getPageLayout()

  • 1
    So, How can I get Page layout 'cutome_home' ID? – Ketan Borada May 30 '18 at 9:50
  • I want to put there condition if it is 'Test Category Page' layout – Ketan Borada May 30 '18 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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