Magento folder structure

Folder structure!?

Why should i learn about folder structure? Because it is Magento. and I think it is the most important part in Magento.

Before we learn about themes and extensions, we should know how folders should be created/placed.

Why this is required?

magento folder structureSuppose product details file is missing from our server, what will happen? Product information page will be blank in front-end! So Magento devs came up with wonderful idea.

They created three different locations for same layout/template/css files. so now from above example if product detail file is missing in one folder,Magento will look into second folder for that file,if it didn’t find there, it will look into third folder for the same file. Interesting!? Lets dig into it.

Understanding Magento Folder Structure

We should know about these three folders  to modify the store as per requirement :

1) Design   2) Skin   3) Code

Design :

This folder path is Magento_folder/app/design, It consists of three folders:

1) adminhtml : It is used to render admin panel.

2) frontend : As name suggests, it will render our front-end. Here is the main part, It also consists of three folders:

  1. base : It consists of Magento default code. (One should avoid editing these files, we can copy required files to same hierarchy in default or theme folder.)
  2. default : It may content theme and default code both.
  3. package_theme_folder : It is your theme folder. (In Magento 1.9 there is rwd folder, it is theme of this new version.)

All these three folders consist layout (.xml files) and template (.phtml files) folders.

3) install :  It is used to render installation pages.

Code :

This folder path is Magento_folder/app/code. It consists of php code, It is divided in three folders/code pools.

  1. core : Default Magento code. (Do not modify this code. Ever!)
  2. local : Locally created extensions.
  3. community : Externally/third party created extensions.

As we know Magento is following mvc structure, so mostly all folders in these code pools will have Block,controller,etc,Model and Helper.

Skin :

It will have same structure like Design folder. Just the difference is it will include css,js and Images folder instead layout folders.

Look at this image, You will be more clear about folder structure.

magento folder structure

Note 1: To edit Magento’s default code copy that file in same hierarchy to app/code/local/Mage folder.

Note 2 : Magento will search template/css files in following folders respectively .
1. Package/ Theme_name
2. Default/Default
3. Base/Default

So this was all about Magento folder structure, Hope now you are clear about this. Let me know if any questions in comments.

The following two tabs change content below.
Ankur Dholakia

Ankur Dholakia

Magento Developer | Entrepreneur at iBiz Technologies
Magento Developer, Entrepreneur, Day Dreamer!

There are no comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Start typing and press Enter to search

Shopping Cart