0

I am working on a Magento 2.1.7 shop and I have created a child-theme of Magento Blank.

I've changed the layout of my homepage to 2 columns with left bar from Content -> Pages. I need to do the same for the product page.

As can be seen in the image below, I don't have this option for the product page:

enter image description here

Can I enable changing this layout from Content -> Pages? If not is there an alternative (best way) to get the same result?

Thank you!

0

For product page layout change there is no option in admin (unless you want it for a particular product, for that you can choose layout in edit product page under design tab), you can do it using xml file. Follow below to change layout using xml

Copy catalog_product_view.xml from vendor\magento\module-catalog\view\frontend\layout to your theme.

and in this file you can change layout in below code

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

</page>
  • I would like to use the exact same layout for the product page and homepage. Where can I find the homepage layout file to copy its content _to _ the product page? – Razvan Zamfir Dec 6 '17 at 11:56
  • use above code it will set the same 2 columns with left bar layout for your product page – Piyush Dec 6 '17 at 12:08
0

There are two ways to do this

1. Do it programmaticaly & do changes into your own theme which will apply the changes to every products page you are entering from backend. (Recommanded)

Go to this place into your Magento_root

magento_root\vendor\magento\module-catalog\view\frontend\layout

Copy a file 'catalog_product_view.xml' & put it at

magento_root\app\design\frontend\Your_Package\your_theme\Magento_Catalog\layout Find this code

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

And replace it with

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

2. When You are entering the products do it there by selecting the layout But it will remain onto that products page only.

Go to Products >> Catalog >> Add New Product/Edit Product >> Design Layout

Select 2 Columns with left bar

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.