cancel
Showing results for 
Search instead for 
Did you mean: 

local.xml not working

local.xml not working

Hello,

  I'm new to Magento, previously used osCommerce. I'm trying to use Magento with Bootstrap. Followed all the instructions, i'm testing the local.xml file. Following is the code i'm using in local.xml to test website:

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
<default module="page" translate="label">
<reference name="head">
<!-- Adding Javascripts -->
<action method="addItem">
<type>skin_js</type>
<name>js/jquery.min.js</name>
</action>
<action method="addItem">
<type>skin_js</type>
<name>js/bootstrap.min.js</name>
</action>
<action method="addItem">
<type>skin_js</type>
<name>js/jquery.scripts.js</name>
</action>
<action method="addItem">
<type>skin_js</type>
<name>js/html5shiv.js</name>
<params/>
<if>lt IE 9</if>
</action>
<action method="addItem">
<type>skin_js</type>
<name>js/respond.min.js</name>
<params/>
<if>lt IE 9</if>
</action>
<!-- Removing the styles.css -->
<action method="removeItem">
<type>skin_css</type>
<name>css/styles.css</name>
</action>
<!-- Adding Bootstrap Css -->
<action method="addCss">
<stylesheet>css/bootstrap.min.css</stylesheet>
</action>
<!-- Adding the styles.css -->
<action method="addItem">
<type>skin_css</type>
<stylesheet>css/styles.css</stylesheet>
</action>
</reference>
<!-- // Default -->
<reference name="root">
<action method="setTemplate">
<template>page/2columns-left.phtml</template>
</action>
</reference>
<!-- Left Sidebar -->
<reference name="left">
<!-- remove the default newsletter block from the sidebar -->
<remove name="left.newsletter"/>
</reference>
<!-- // Left Sidebar -->
</default>
</layout> 

  When I refresh website nothing happens, the default Madison Island appears with no alteration. Is there something missing or something needs to be done on my part to see changes. Will be grateful for all help.

3 REPLIES 3

Re: local.xml not working

Where did you place the boostrap files?

 

Do you know that it is in fact not loading? It might not be visible on the pages because there are no bootstrap classes?

 

See my post on using boostrap to make a theme for scratch - it might help.

http://kimberelyt.com/magento-tutorials/day-1-creating-a-magento-reponsive-theme-with-twitter-bootst...

 

Let me know, I will check back with you!

Kimberely Thomas
Magento Certified Solution Specialist
Business Solutions Architect
Magento, Expert Consulting Group
@magentogirl

Re: local.xml not working

Hello,

  Many thanks for your reply. Actually I had seen your posting on bootstrap. I was following that as well as Mastering Magento Theme Design by Andrea Sacca. I placed bootstrap.min.css in skin/frontend/mytheme/default/css, bootstrap.min.js in skin/frontend/mytheme/default/js and pasted fonts folder in skin/frontend/mytheme/default/fonts. I wonder what would be the best way to test whether the code is working or not. In, say, C++ you could test a program by having breakpoints, watching the Debug window, executing program line by line, etc. I do not know how to test this code that is sitting on a remote server! (Also cache is not an issue as I've cleared and disabled cache.)

Re: local.xml not working

Simply adding bootstrap lib to RWD theme won't work, you will still have to modify tons of template. I would suggest you download a magento bootstrap template and work on that.

 

As why is the local.xml not working, you shoud first check if the new libs are in the html head or in the compiled js and css file(you said you had cleared cache, but had you recompiled Js and Css, by the button below cache management grid?). If they are not, you can debug in this way, open app/code/core/Mage/Page/BLock/Html/Head.php, find addItem, and insert something like this

if($params = 'css/bootstrap.min.css') {
    echo 'bootstrap css inserted'; exit();
}

you can also use xdebugger, but it involves more configuration