
New developers to Magento can find it a puzzling system in terms of system architecture. In this article I hope to shed some light on some of the key directories in Magento and what they do so any Magento developers out there aren’t quite as confused when unzipping their first set of Magento install files.
Here’s seven key things you need to know the location of at some point when developing with Magento and the directories that they are stored in.
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.
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.
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/.
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.
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
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.
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. I hope you can now go away and navigate around Magento’s default folders with ease.
Thanks for sharing. I was getting lost in folder structure for a client project. This post will make things easier :)
I really appreciate this post, but I really cant find the place of the var directory from where can i go to it or access it from mmy backend,
Thanks in advance
hmn – it should be in your root Magento folder. So if you Magento installation is in /htdocs/ it will be located at the address /htdocs/var/
awesome article
helped alot for the beginer users
thanks alot
Hi
can you please give me the full path to find media/import directory.
Thanks in advance
Hi Jamie, I found this article via a Google search and only realised it was you when I recognised the favicon from your twitter account. Thanks for the article, I can now rest assured that deleting the contents of my var directory is ok. Cheers! Jon
Real helpful, great bit. Im learning Magento and the documentation is…… sparse… i found your blog my checking out Magento 1.3: PHP Developer’s Guide (Paperback) on Amazon, google search, and here I am.
Im wrapping my head around the .xml layout system now… hopefully there are more good posts about magento in this blog to discover. an yea, looking foward to the book dropping, thanks again.
CONCERNING IMPORTING IMAGES IN MAGENTO:
1) When importing products you will need first to create a sample products and run the profile (in your admin–> system->import/export).
The exported file will be then located in yourwebsitemaindirectory/var/export
2) On this CSV file you will see the table field name on the first raw.
Things are pretty straigtforward except for the images file.
3) Images
you have 3 images fields: “image”;”smallimage”;”thumbnail”
“image” is the main image is the main image of your products on your product page.
“smallimage” and thumbnail “thumbnail” are dedicated to the images used in the category view, when all of its products are listed.
In those field simply add your image name preceded by a slash/ and place all your images in the following directory: “media/import”.
never mind if in your export file you see the sample product image directory starting with N/S or M/e, ignore this, simply put your image name preceded by a slash /
4) Import
Then go back to your admin–> system->import/export and run an import profile.
I have to modify some functionality for a front end view in Magento. The file I currently suspect to be changed is template/catalog/product/view> attributes.phtml
I would like to know if this will later be affected if I update my Magento installation.
From your desciption it does not seem so, but I would like to be sure before proceeding with the change.
Thx for the information. I really appreciate this post.
The seven points mentioned here which can be taken in view when developing with Magento are really so helpful for the Magento developers.