1

4column.xml我正在尝试添加新布局cms->pages->layout

我找到这个教程

http://www.crearegroup-ecommerce.co.uk/blog/magento-tutorials/create-new-layouts-for-your-template-pages.php

并实施它。

但它只显示4column 布局

所以我删除更改并清除缓存以显示其他布局

不幸的是在我的cms->pages->Design->layout

下拉菜单为空

如何解决这个问题我想要我的默认布局

请帮我

没有人尝试上面的链接

4

2 回答 2

3

尝试这个

我遇到了类似的问题并像这样解决

core folder 复制这个文件即core\code\mage\page\etc\config.xml

并像这样覆盖

core\code\mage\page\etc\config.xml

刷新缓存

于 2012-12-07T17:25:21.527 回答
2

您缺少layout_handle节点:

<global>
    <page>
        <layouts>
            <your_mod module="your_mod" translate="label">
                <label>Your Mod Custom Layout</label>
                <template>your_mod/custom_layout.phtml</template>
                <layout_handle>custom_layout</layout_handle>
            </your_mod>
        <layouts>
    <page>
</global>

您可以将其保留在您的app/etc/local.xml 中,或者您可以创建一个新模块,该模块将通过指定一个新的布局更新 XML 文件来构建其余功能,您将在其中包含以下内容:

<global>
    <helpers>
        <your_mod>
            <class>Your_Mod_Helper</class><!-- if you are translating the label -->
        </your_mod>
    </helpers>
    <page>
        <layouts>
            <your_mod module="your_mod" translate="label">
                <label>Your Mod Custom Layout</label>
                <template>your_mod/custom_layout.phtml</template>
                <layout_handle>custom_layout</layout_handle>
            </your_mod>
        <layouts>
    <page>
</global>
<frontend>
    <layout>
        <updates>
            <your_mod module="Your_Mod">
                <file>your_mod/layout.xml</file>
            </your_mod>
        </updates>
    </layout>
    <!-- if you are translating the label -->
    <translate>
        <modules>
            <Your_Mod>
                <files>
                    <default>Your_Mod.csv</default>
                    <!-- ref app/locale/en_US for examples -->
                </files>
            </Your_Mod>
        </modules>
    </translate>
</frontend>

最后,在 *app/design/frontend/base/default/layout/your_mod/layout.xml* 中:

<!-- ref. to last handles in app/design/frontend/base/default/layout/page.xml -->
<custom_layout translate="label">
    <label>Your Mod Custom Layout</label>
    <reference name="root">
        <action method="setTemplate"><template>your_mod/custom_layout.phtml</template></action>
        <!-- Mark root page block that template is applied -->
        <action method="setIsHandle"><applied>1</applied></action>
    </reference>
</custom_layout>

据我所知,这是一种优化,它允许视图计算的各个区域具有设置根块模板的逻辑,而无需执行已完成的工作。

于 2012-11-28T13:07:29.960 回答