I want to change my category page layout to 2columns-left.phtml
. The default is a 3 column layout. I only want to set the category page layout to 2columns-left.phtml
. The rest should keep the default page layout (3 columns). How can I do this?
A page layout file defines the page wireframe, for example, one-column layout. Technically page layout is an . xml file defining the structure inside the <body> section of the HTML page markup. Page layouts feature only containers.
You can get a list of called Layout XML for specific pages by Magento\Framework\App\View class. Call getLayout() method from Magento\Framework\App\View. php class. getLayout()->getUpdate()->getHandles() used for getting all the handles of a page.
You can do this for categories individually under the Design tab. You can do this for all categories by adding a local.xml
to your custom theme's layout
folder which contains the following:
<?xml version="1.0"?>
<layout>
<my_category_root_template>
<reference name="root">
<tpl>page/2columns-left.phtml</tpl>
</reference>
<my_category_root_template>
<catalog_category_layered>
<update handle="my_category_root_template" />
</catalog_category_layered>
<catalog_category_layered_nochildren>
<update handle="my_category_root_template" />
</catalog_category_layered_nochildren>
<catalog_category_default>
<update handle="my_category_root_template" />
</catalog_category_default>
<!-- EDIT: forgot about search results page -->
<catalogsearch_advanced_result>
<update handle="my_category_root_template" />
</catalogsearch_advanced_result>
<layout>
For further info, Magebase has a great Layout XML primer, and Alan Storm wrote the book on it.
I don't have much experience with magneto but i think it may work.
Go to admin->Catalog->Categories->Manage Categories
Then go to ->Custom Design
You will find Page Layout option there change that to whatever you like.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With