I am using Magento blank theme, I want to change the layout on Product detail page, on product details page the default layout is 1column layout. How to change from 1column layout to 2columns-left layout. Please help me. Thanks in Advance.
2 Answers
You can try following : In your Layout file inside the theme :
app\design\frontend\Vendor\ThemeName\Magento_Catalog\layout\catalog_product_view.xml
<?xml version="1.0"?>
<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
.............
.............
Another option in your Layout file inside the custom module:
app\code\Vendor\ModuleName\view\frontend\layout\catalog_product_view.xml
<?xml version="1.0"?>
<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
.............
.............
You can change containers from layout.xml If you are working on default theme "Luma" then you can find layout.xml in "\vendor\magento\module-theme\view\frontend\layout". Otherwise you can find it in your theme "\vendor_name\theme_name\magento_theme\view\frontend\layout"
Thanks