Chapter 4. Magento Layout

You have now looked at the changes you can make to your Magento theme using CSS and template changes. This chapter introduces Magento's layout language, which can be used to change the appearance and order of blocks within your Magento theme and covers the following:

  • Adding a local.xml file to your theme
  • Changing the default page template
  • Changing a page's layout via CMS
  • Adding a static block to a page using the Magento layout
  • Changing the ordering of blocks in Magento's sidebar
  • Removing unnecessary blocks from Magento's sidebar
  • Adding a new products block to your store's home page

Adding local.xml to your Magento theme

As you have seen, Magento provides fallbacks to fill in the files not provided by your theme to help ensure your website functions as effectively as possible. You can overwrite the layout information in your Magento theme by applying a local.xml file to your Magento theme.

Create a file called local.xml in your theme's /app/design/frontend/default/m18/layout/ directory, and include the following XML:

<?xml version="1.0"?>
<layout>
</layout>

This is the very least your Magento XML layout file requires: all of the subsequent changes to your theme's layout need to be written in the <layout> element.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.126.199