Magento Layout local.xml中奇怪的布局行为

Magento Layout local.xml中奇怪的布局行为,xml,magento,templates,layout,php,Xml,Magento,Templates,Layout,Php,有一个奇怪的问题我有点困惑,因为我很确定我在这里做的每件事都是正确的 我正在使用Magento CE 1.8.1.0,这是我目前的local.xml: <?xml version="1.0"?> <layout> <default> <reference name="root"> <action method="setTemplate"><template>page/2colu

有一个奇怪的问题我有点困惑,因为我很确定我在这里做的每件事都是正确的

我正在使用Magento CE 1.8.1.0,这是我目前的local.xml:

<?xml version="1.0"?>
<layout>
    <default>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
        <!-- Blocks to Remove from Layout -->
        <remove name="paypal.partner.right.logo" />
        <remove name="right.permanent.callout" />
        <reference name="right">
            <remove name="right.poll" />
        </reference>
        <reference name="head">
            <action method="addItem"><type>skin_css</type><name>css/combined.css</name></action>
            <action method="addJs"><script>modernizr/modernizr-2.6.2-respond-1.1.0.min.js</script></action>
        </reference>
        <reference name="before_body_end">
            <block type="page/html_head" name="footer_scripts" as="footerScripts" after="-" template="page/html/footer/footer-scripts.phtml">
                <action method="addJs"><script>jquery/jquery-1.11.0.min.js</script></action>
                <action method="addItem"><type>skin_js</type><name>js/combined.js</name></action>
            </block>
        </reference>
    </default>
</layout>

第页/2列-left.phtml
skin_csscss/combined.css
Modernizer/Modernizer-2.6.2-respond-1.1.0.min.js
jquery/jquery-1.11.0.min.js
skin_jsjs/combined.js

我遇到的问题是根模板设置不正确。它使用的是base2columns-right.phtml文件。我在这里遗漏了什么?

现在无法深入了解代码,但我的猜测是,因为您使用默认句柄,所以当您检查完所有其他内容后,会被其他布局句柄覆盖


由于主页本质上是一个CMS页面,它在“CMS>页面>主页>设计>布局”下分配了一个默认模板,因此无论您如何在布局XML文件(local.XML)中覆盖该模板,它都将始终使用CMS中配置的模板。只需将其更改为您想要的,它将使用您在local.xml中指定的自定义.phtml文件。

您要在哪个页面上设置2列-left.phtml?因此,您必须在适当的手柄上设置模板。我希望将其设置为默认根模板。这已经排序,因为我忘了进入CMS页面部分并设置模板。