dongxietao0263 2014-10-21 20:49
浏览 25

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

I am creating a magento theme. I set 2columns-right layout for all page. Now I want to create a template and set 1columns layout for home page from local.xml. But admin home page cms selected layout still remains and my created and admin home page cms content both still show. So how can I avoid admin home page cms layout and content without disable and set 1columns layout for home page. Any suggestion and help are appreciated. Thank you.

Here is my code:

<?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>
  • 写回答

1条回答 默认 最新

  • dro62273 2014-10-22 01:41
    关注

    What you're looking for is something like this:

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

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘