官术网_书友最值得收藏!

The basic concepts of a Magento theme

Before you begin to create your theme, there are some basics you need to know that will help you. This is supposed to be a review of the basic concepts and techniques that you should already know, which will speed up the development of the theme.

The Magento base theme

The base theme was introduced in the CE (Community Edition) Version 1.4 and EE (Enterprise Edition) Version 1.8. The main difference between the CE and EE is the price and support.

In fact, the CE is open source and anyone can download and use it as an e-commerce platform. The EE has an annual fee of $12,000, and it has the same base of the community edition but it is aimed to companies that needs special customizations, additional functionality, and the support of the Magento team.

It's very important to understand that the base theme of Magento is essential to make the other themes work correctly, which in fact will depend on it. The base theme is the core of the Magento frontend.

The following are the frontend base theme directories:

  • app/design/frontend/base
  • skin/frontend/base/

The hierarchy of files and the fall-back system

The frontend of Magento has been structured in such a way that it allows the designers to create themes based on the basic theme, without changing its structure. This fall-back system allows us to create only the files that are necessary for the customization of our theme. All other files, if any, will be taken from the base theme.

In order to create the theme's files, we can proceed in the following two ways:

  • Create the empty files in the appropriate directories and write all the code by hand. You can choose this option if you are an advanced developer who knows how to get the information in the right way from the database.
  • Copy the files from the base theme and edit them accordingly. You can use this option to analyze and study the code, and learn how to retrieve the information of the products, blocks, and so on.

In this book, we will use the second option, which is easier and faster. In the theme you need to create/duplicate only the strictly necessary files for its customization. This allows you to have a theme that is much lighter and with fewer files.

For example, let's say we want to change the header.phtml file that is the block of the theme header. You can copy the header.phtml file from the app/design/frontend/base/default/template/page/html/ path to the app/design/frontend/custom_package/custom_theme/template/page/html/ path.

Tip

It is absolutely important to know that you must not create a theme under the base package; you should create a custom package and place the themes inside it.

主站蜘蛛池模板: 霍州市| 宣武区| 绍兴县| 贵南县| 洪江市| 聂荣县| 乐安县| 渭南市| 慈溪市| 绥江县| 平和县| 汽车| 南安市| 都兰县| 伊宁县| 四子王旗| 宁明县| 罗甸县| 吕梁市| 静海县| 西昌市| 尉犁县| 抚宁县| 马公市| 霍林郭勒市| 许昌市| 新龙县| 鄂温| 克拉玛依市| 巨鹿县| 邯郸县| 玛多县| 华宁县| 汉寿县| 济南市| 苍溪县| 咸宁市| 赣榆县| 中西区| 湖口县| 高阳县|