[英]How to create home page cms template from local.xml in magento
我正在创建一个magento主题。 我为所有页面设置2columns-right布局。 现在,我想创建一个模板,并从local.xml设置主页的1列布局。 但是管理员主页cms选定的布局仍然保留,并且我创建的内容和管理员主页cms内容仍然显示。 因此,如何在不禁用管理主页cms布局和内容的情况下禁用它并为主页设置1columns布局。 任何建议和帮助表示赞赏。 谢谢。
这是我的代码:
<?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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.