In magento 2, Product detail page is coming with different layout, some product render with 1 page column while some with 2 column, i saved all product in admin for NO LAYOUT but its not working, how to resolve this. I need 1 column layout only. I am using Magento ver. 2.0.7

2 Answers 2


At magento, top most priority is Db values.

So, If you will saved all product in admin for 1Column then it may be work's Note: that after apply, you need to flush cache.

If it is not work then there are should be some observer which change pay layout


for this case, you can use event layout_generate_blocks_before,using this event you can change pagelayout


namespace [Vendor]\[ModuleName]\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\Request\DataPersistorInterface;
use Magento\Framework\App\ObjectManager;

class ObserverChangeLayoutForProductview implements ObserverInterface

     * @var \Magento\Framework\App\ActionFlag
    protected $_actionFlag;

     * @var \Magento\Framework\Message\ManagerInterface
    protected $messageManager;

     * @var \Magento\Framework\App\Response\RedirectInterface
    protected $redirect;

    private $_pageConfig;

     * @param \Magento\Framework\App\ActionFlag $actionFlag
     * @param \Magento\Framework\Message\ManagerInterface $messageManager
    public function __construct(
        \Magento\Framework\App\ActionFlag $actionFlag,
        \Magento\Framework\Message\ManagerInterface $messageManager,
    \Magento\Framework\View\Page\Config $pageConfig     
    ) {
        $this->_actionFlag = $actionFlag;
        $this->messageManager = $messageManager;
        $this->redirect = $redirect;
         $this->_pageConfig = $pageConfig; 

     * @param \Magento\Framework\Event\Observer $observer
     * @return void
    public function execute(\Magento\Framework\Event\Observer $observer)
        /** @var \Magento\Framework\App\Action\Action $controller */
        $full_action_name = $observer->getFullActionName();

        $layout = $observer->getEvent()->getLayout();
        if($full_action_name == 'catalog_product_view'){



Override catalog_product_view.xml in your module and add below code.

<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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