Thứ Sáu, 27 tháng 11, 2015

HOW TO FIND WHICH LAYOUT FILE TO MODIFY


To access the layout files, go to app/desi gn/frontend/design_pa cka ge/theme_va riation/la yout/. Just like the
templates, layouts are saved on a per-module basis therefore you can easily locate the layout file to modify with the help of the Template Hints.

To enable Template Hints, go to System à Configuration à Advanced à Developer. At this point you will need to make sure you have your website selected in the Current Configuration  Scope dropdown instead of Default Config. Once your website is selected in the dropdown, click  Debug. Here, you can change Template Path Hints to Yes. If you want even further information, you can also change Add Block Names to Hint to Yes.

Now that you have Template Hints enabled, reload the page you want to modify, and look at the path of the template file(s) that the Template Hints will provide you with. If you want to (for instance) move the mini cart, reference the template path (ex:app/design/frontend/base/default/template/checkout/cart/sidebar.phtml) and use the first folder name inside the theme folder (indicated in bold, which is the module name) to find
the according layout file. Therefore, in the case of the mini cart, you know to look in ”checkout.xml” to modify the mini cart positioning. Each layout file is further broken into handles, which specify layouts for specific page types. Each area of per-page layout is clearly marked with comments reflecting its usage, but the application itself recognizes the layout separation by the handles of each layout.


Không có nhận xét nào:

Đăng nhận xét