【问题标题】:How to create home page cms template from local.xml in magento如何在magento中从local.xml创建主页cms模板
【发布时间】:2014-10-21 20:49:16
【问题描述】:

我正在创建一个 magento 主题。我为所有页面设置了 2columns-right 布局。现在我想创建一个模板并从 local.xml 为主页设置 1columns 布局。但是管理员主页 cms 选择的布局仍然存在,并且我创建的和管理员主页 cms 内容仍然显示。那么如何在不禁用和设置主页的 1columns 布局的情况下避免管理主页 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>

【问题讨论】:

    标签: php xml magento magento-1.7


    【解决方案1】:

    你正在寻找的是这样的:

    <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>
    

    【讨论】:

      猜你喜欢
      • 2012-02-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-31
      • 1970-01-01
      • 2023-03-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多