Magento 2 Theme Structure

Magento 2 theme structure is basic and important part which are need to understand during whenever someone want to explore the Magento 2 E-commerce Solution.

In Magento 2 themes files are located in app/design/frontend/<Vendor>/. And built in theme are located in vendor/magento/theme-frontend whenever magento 2 instance is deployed from composer.

Typical Structure Of Magento 2 Theme Directory:

following is the structure of theme directory

<theme_dir>/

  • <Vendor>_<Module>/
    •  Web/
    •  Layout/
    •  templates/
  • etc/
  • i18n/
  • media/
  • web/
  • composer.json
  • registration.php
  • theme.xml

Lets explain each of directory and file for theme in details.

  • <Vendor>_<Module>

Module specific styles, layouts and templates contain in this folder.

  • etc 

This folder contain file view.xml which have configuration for for stores product images, thumbnail.

  • i18n

All translation csv files are located in this i18n folder.

  • media

It contains screenshot of theme file for preview.

  • web

All static files like css, js and images for background will be located in this folder for loading into frontend.

  • composer.json

It have theme dependencies and some meta-information.

  • registration.php

This file is required to register your theme in the system.

  • theme.xml

It contains the basic meta-information, like the theme name and the parent theme name, if the theme is inherited from an existing theme. The file is used by the Magento 2 system to recognize the theme.

Required Files For Magento 2 Theming:

Following is the list of files which are required for magento 2 theming system.

  1. etc/view.xml
  2. registration.php
  3. theme.xml

This is introduction for magento 2 theming. Advance topic will be discussed in later on.

(Visited 91 times, 1 visits today)