The Magento File Structure and Architecture

When you start working with Magneto, you may find it confusing as to the directory structure. In this article I hope to help shed a little light on some of the key directories in Magento and what they do so that maybe when you’re working in Magento, things will make a little more sense.

Here are a few things you need to know the location of at some point when developing with Magento and the directories that they are stored in.

1. The templates file

/app/design/ is the core storage folder for template files. With it breaking down into adminhtml/ for administration templates, frontend/ for frontend templates and install/ for installation templates.

Within these you’ll find your default template set aptly named default. In your template set folder are your individual theme folders that come with Magento.

layout, locale and template are the core directories that contain the files that make up your themes.

2. The skin files (resources, components, resources)

In /skin/ you’ll find your CSS, images, Flash, JavaScript and any other resource files that relate specifically to templates in the system. You will also find the adminhtml, frontend and install directories distinction here.

3. Language files and e-mail templates

/app/locale/ is your core directory. With sub-directories for each language set installed for the store. You will find .csv files for each of the modules installed on the system relating to their translations. You’ll find the Magento e-mail templates in /template/email/ within your language directory in /app/locale/.

4. Core configuration

/app/etc/ contains all configuration files for Magento. From the local.xml file which contains your database configuration, amongst other things. To your modules/ folder which contains the declaration of modules in the system.

5. Local, core and community modules

All modules for functionality are stored in /app/code/ and are broken down into the following folders:

  • community – for modules installed via Magento Connect.
  • core – for modules that come with Magento by default.
  • local – usually for locally developed modules

6. Media files

All images uploaded to the system as well as the images resized dynamically by the system are stored in media/.

When importing media files via system profiles (Magento’s name for batch processing), /media/import/ will be your folder to place the images for the products.

7. The var directory

The var directory is used for several functions in the system:

  • Backups are exported to backups/ by the built in system backup tool.
  • The system cache is stored in both cache/ and session/ folders.
  • Data import for default system data import profiles is set to import/.
  • Data export for default system data export profiles is set to export/.

Hopefully this has given you a good indication as to the important directories in Magento’s file structure.

You must be logged in to post a comment.