我试图在cms->pages->layout
中添加一个新的布局4column.xml
我找到这个教程
http://www.crearegroup-ecommerce.co.uk/blog/magento-tutorials/create-new-layouts-for-your-template-pages.php
并实施它。
但它只显示 4 列布局
所以我删除了更改并清除缓存以显示其他布局
不幸的是,在我的cms->页面>设计>布局中
下拉列表为空
如何解决这个问题,我想要我的默认布局
请帮助我
没有人尝试上面的链接
试试这个
我遇到过类似的问题并像这样解决
在core folder
复制此文件,即corecodemagepageetcconfig.xml
并像这样覆盖
corecodemagepageetcconfig.xml
刷新缓存
您缺少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>
您可以将其保留在您的应用程序/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>
据我所知,这是一种优化,它允许视图计算的各个区域具有设置根块模板的逻辑,而无需执行工作(如果已经完成)。