magento 自定义布局方式

一、在目录app/design/frontend/default/yourtheme/template/page/ 下新建一个布局文件cmscolumn.phtml。

二、在app/design/frontend/default/yourtheme/template/layout/page.xml 中”Custom page layout handles”标签里加以下代码,其中有其他布局文件的写法,可以仿照。

<page_cms_columns translate="label">

        <label>All cms-Column Layout Pages</label>

        <reference name="root">

            <action method="setTemplate"><template>page/cmscolumn.phtml</template></action>

            <!-- Mark root page block that template is applied -->

            <action method="setIsHandle"><applied>1</applied></action>

        </reference>

    </page_cms_columns>

三、在app/code/core/Mage/Page/etc/config.xml中47行”layouts”标签里加入以下代码,同样有其他布局文件的写法,可参考

<cms_columns module="page" translate="label">

                    <label>cms column</label>

                    <template>page/cms.phtml</template>

                    <layout_handle>page_cms_columns</layout_handle>

</cms_columns>

四.清除缓存OK
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值