如何在magento中从local.xml创建主页cms模板


How to create home page cms template from local.xml in magento

我正在创建一个magento主题。我为所有页面设置了2列的正确布局。现在,我想创建一个模板,并从local.xml为主页设置1列布局。但管理员主页cms选择的布局仍然保留,我创建的和管理员主页的cms内容仍然显示。那么,我如何在不禁用和设置主页1列布局的情况下避免管理主页cms布局和内容。如有任何建议和帮助,我们将不胜感激。非常感谢。

这是我的代码:

<?xml version="1.0" encoding="UTF-8"?>
<layout>
    <!-- Global Operations -->
    <default>
        <reference name="root">
            <action method="setTemplate">
                <template>page/2columns-right.phtml</template>
            </action>
            <reference name="content">
                <block type="core/template" name="some_random_name" template="cms/home.phtml"/>
                <action method="setTemplate"><template>page/1column.phtml</template></action>
            </reference>
        </reference>
    </default>
</layout>

您想要的是这样的东西:

<layout version="0.1.0">
    <cms_index_index>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
            <!-- <action method="setTemplate"><template>page/2columns-right.phtml</template></action> -->
            <!-- <action method="setTemplate"><template>page/3columns.phtml</template></action> -->
            <!-- <action method="setTemplate"><template>page/1column.phtml</template></action> -->
        </reference>
    </cms_index_index>
</layout>