Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Adding local.xml to theme crashes frontend
 
a_harvie
Jr. Member
 
Total Posts:  2
Joined:  2013-01-28
 

EDIT: found a solution, posted below.

Hello all,

I’m adding a theme to a 3rd party package, which contains a ‘default’ theme:

app/design/frontend/ultimo/default/

So I’ve added:

app/design/frontend/ultimo/mytheme/

In mytheme/ I’ve overridden several template .phtml files. This works as expected.

I’m trying to adjust some default layout by adding a local.xml file to:

app/design/frontend/ultimo/mytheme/layout/local.xml

But if this file is present, the frontend fails to render completely. It doesn’t seem to matter what is in the file at all. I’m testing with this content:

<?xml version="1.0" encoding="UTF-8"?>
<layout>
    <default>
        <
reference name="root">
            <
action name="unsetChild">
                <
alias>breadcrumbs</alias>
            </
action>
        </
reference>
    </default>
</
layout>

As mentioned, the frontend crashes no matter what the content of that file. I’ve tried many different things in the XML.

The crash always generates the same report:

a:5:{i:0;s:127:"Invalid method Mage_Page_Block_Html_Topmenu::renderCategoriesMenuHtml(Array
(
    [0] => 
    [1] => 0
    [2] => level-top
)
)"
;i:1;s:4692:"<stack trace removed>";}
(With a long stack trace, that doesn’t seem to mention anything to do with layout errors, I can post it if necessary.)

Any idea if I’m doing something wrong?

SOLUTION:

I copied the entire contents of the base theme’s local.xml from ultimo/default/layout/local.xml to ultimo/mytheme/layout/local.xml and then made the changes I want.

I thought that layout xml was all compiled to one structure, so I could just use <reference> tags to override what I want in my local.xml, but if I don’t include the entire local.xml structure from the package default, it crashes. Not sure why.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lyonscg
Sr. Member
 
Avatar
Total Posts:  173
Joined:  2009-11-13
Chicago IL
 

You’re initial assumption is correct. You should be able to start with a blank local.xml and then add references to what you want to change. We do this a lot because it keeps things very clean and manageable. As for your error. I’ve seen it as well in the past and it has always been related to the unsetChild.

You’re probably moved on by now, but if you curiosity gets the better of you and try removing just the unsetChild and perhaps replace it with <remove name="” />. Let us know how it turns out =)

Otherwise, at least you have a working solution. Good luck

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top