【问题标题】:local.xml added to Magento layout directory but is not being applied and is ignoredlocal.xml 添加到 Magento 布局目录但未被应用并被忽略
【发布时间】:2014-07-18 11:08:44
【问题描述】:

我正在使用来自 Specify Category specific layout updates without using Magento's administration dashboard 的 Alan Storm 的建议,在我的 local.xml 中使用了几个特定于类别的布局更新。

我已经验证了 xml,它作为有效的 xml 返回。我已启用法师开发者模式以报告错误并查看异常日志以查看是否有问题,但没有运气。

这是我的 local.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * local.xml
 *
 * Local layout modifications for our local theme
 *
 * @category    design
 * @package     my_theme_default
 * @copyright   Copyright (c) 2011 Magebase.
 */
-->
<layout version="0.1.0">
<default>
    <reference name="root">
        <remove name="breadcrumbs"/>
        <remove name="left.permanent.callout" />  <!--the dog-->
        <remove name="right.permanent.callout" />  <!--back to school-->
    </reference>
</default>
<reviews>
    <reference name="root">
        <remove name="header"/>
        <remove name="footer"/>
    </reference>
</reviews>
<review_product_list>
    <reference name="root">
        <remove name="header"/>
        <remove name="footer"/>
    </reference>
</review_product_list>

<CATEGORY_11> <!-- cat 5 or cat 6 -->
            <reference name="content">
                <block type="core/template" name="page.brand" template="page/brand.phtml" />
                <block type="catalog/product_list" name="product_list" template="page/gourmet.phtml">
                    <block type="catalog/layer_view" name="filter_menu" template="catalog/layer/view.phtml"/>
                </block>
          </reference> 
</CATEGORY_11>

<CATEGORY_12><!--cat 7 or cat 8 -->
            <reference name="content">
               <block type="core/template" name="page.brand" template="page/brand.phtml" />
                <block type="catalog/product_list" name="product_list" template="page/toiletries.phtml">
                    <block type="catalog/layer_view" name="filter_menu" template="catalog/layer/view.phtml"/>
                </block>
            </reference>
</CATEGORY_12>

<CATEGORY_9> <!--cat 4 or cat5 -->
            <reference name="content">
                <block type="core/template" name="page.brand" template="page/brand.phtml" />
                <block type="catalog/product_list" name="product_list" template="page/fashion.phtml">
                    <block type="catalog/layer_view" name="filter_menu" template="catalog/layer/view.phtml"/>
                </block>
          </reference>
</CATEGORY_9>

<CATEGORY_6> <!--cat_11 cat_3 -->
            <reference name="content">
                <block type="core/template" name="page.brand" template="page/brand.phtml" />
                <block type="core/template" name="page.flip" template="page/flip.phtml" />
                <block type="catalog/product_list" name="product_list" template="page/accessories.phtml">
                    <block type="catalog/layer_view" name="filter_menu" template="catalog/layer/view.phtml"/>
                </block>
          </reference>
</CATEGORY_6>

<CATEGORY_10> <!-- cat 6 or 7 -->
            <reference name="content">
                <block type="core/template" name="page.brand" template="page/brand.phtml" />
                <block type="catalog/product_list" name="product_list" template="page/lifestyle.phtml">
                    <block type="catalog/layer_view" name="filter_menu" template="catalog/layer/view.phtml"/>
                </block>
          </reference>
</CATEGORY_10>

</layout>

如果有人能告诉我我做错了什么,将不胜感激。谢谢。

【问题讨论】:

  • 值得注意的是分类页面显示为空白,因为管理面板中没有为 cms 页面设置内容
  • 这个&lt;CATEGORY_11&gt; 存在吗?
  • 为此清除缓存。
  • 嗨,是的,所有类别都存在并且缓存被禁用。
  • 检查您的 xml 文件是否已损坏,即某些标签丢失等。是否已删除此

标签: xml magento magento-1.8 magento-layout-xml


【解决方案1】:

在系统 -> 配置下转到设计。确保根据您的主题正确设置了当前包名称和布局字段。

【讨论】:

  • 当前包名设置为“cn”,布局字段为空白,但我也添加了“cn”,但没有用。
  • 请写下你的目录结构,即设计->前端->等
【解决方案2】:

在询问某人并考虑之后,事实证明我正在查看 cms 页面,并且那些类别布局句柄只更新类别页面而不是 cms 页面,我在类别页面上对其进行了测试,它工作正常。因此,如果我希望这些更新发生在 cms 页面上,我将不得不使用 cms 句柄。

【讨论】:

  • 显然没有像类别那样的 cms 特定句柄(主页除外)。
猜你喜欢
  • 1970-01-01
  • 2011-07-14
  • 1970-01-01
  • 2016-04-04
  • 1970-01-01
  • 2020-12-02
  • 2014-02-25
  • 2011-11-04
  • 2014-12-02
相关资源
最近更新 更多