Book Image

Mastering Magento Theme Design

By : Andrea Sacca
Book Image

Mastering Magento Theme Design

By: Andrea Sacca

Overview of this book

Table of Contents (18 chapters)
Mastering Magento Theme Design
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Integrating the files into the theme


Now that we have all the files, we will see how to integrate them into the theme.

To declare the new JavaScript and CSS files, we have to insert the action in the local.xml file located at app/design/frontend/bookstore/default/layout.

Tip

As explained in the previous chapter, all the overrides of the base theme should go in the local.xml file and we are going to use it to add new CSS and JavaScript files.

In particular, the file declaration needs to be done in the default handle to make it accessible by the whole theme.

The default handle is defined by the following tags:

<default>
   . . .
</default>

The action to insert the JavaScript and CSS files must be placed inside the reference head block. So, open the local.xml file and first create the following block that will define the reference:

<reference name="head">
…
</reference>

Declaring the .js files in local.xml

The action tag used to declare a new .js file located in the skin folder...