0

I am in the process of creating a new Magento 2 theme.

The Theme is based on the Blank theme which comes with Magento 2.

I'm all sorted with the css and the Theme is working too but I now need to layout the different sections on my main page in a particular order.

My Theme has no layout files so do I have to copy them from Blank and put them inside my Theme?

If so where are they and where do I copy theme too?

Is this all I have to do to set the structure of my pages?

1

Take the reference of Magento Luma theme

For example grab the files from luma theme

/vendor/magento/theme-frontend-luma/Magento_Catalog/layout/default.xml

Paste it in your theme directory and modify.

{mytheme-dir}/Magento_Catalog/layout/default.xml

Other option

Copy the layout files from core module, for example

/vendor/magento/module-cms/view/frontend/layout/cms_index_index.xml

Paste it in your theme directory and modify.

{mytheme-dir}/Magento_Cms/layout/cms_index_index.xml

Make sure your naming convention should match.

For more reference please read reference guide

| improve this answer | |
  • What about the 1Column...2Column etc files that are found on Magento 1 ... don't they apply to Magento 2 – user159500 Sep 4 '16 at 11:44
  • you can change in your theme /vendor/magento/module-catalog/view/frontend/layout/catalog_category_view.xml around line number 8 you can find layout="2columns-left" – Krishna ijjada Sep 4 '16 at 11:53
  • Check the link for adding a new columns or having better idea magento.stackexchange.com/questions/118278/… – Krishna ijjada Sep 4 '16 at 12:00
  • My homepage is currently using the 1 Column Layout and the Blank theme as fallback. Where is the layout file please and where do I place it in my theme? Thanks again for your patience...trying to understand this :) – user159500 Sep 4 '16 at 12:01
  • 1
    if you want to modify columns of home page go to admin > cms page > select home page > in the design tab > change the layout as well as by selecting custom theme option in the same tab. – Krishna ijjada Sep 4 '16 at 12:11

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.