将local.xml添加到Magento布局目录中,但未应用并且被忽略 [英] local.xml added to Magento layout directory but is not being applied and is ignored

查看:100
本文介绍了将local.xml添加到Magento布局目录中,但未应用并且被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从以下位置使用Alan Storm的建议:

I'm using Alan Storm's advice from: Specify Category specific layout updates without using Magento's administration dashboard using several category specific layout updates inside of my local.xml.

我已经验证了xml,并且将其作为有效xml返回.我已经启用了Mage开发人员模式来报告错误,并查看了异常日志以查看是否有问题,但是没有运气.

I have validated the xml, and it is being returned as valid xml. I have enabled mage developer mode to on to report an error and have looked at the exception logs to see if something is wrong, however no luck.

这是我的local.xml:

here is my 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>

如果任何人都可以告诉我我在做什么错,那将不胜感激.谢谢.

If anyone can tell me what I'm doing wrong, it would be much appreciated. Thank you.

推荐答案

问了一个人并考虑了一下之后,事实证明我正在查看cms页面,而这些类别布局只处理更新类别页面而不是cms页面,我测试过它在类别页面上,并且可以正常工作.因此,如果我希望这些更新发生在cms页面上,则必须使用cms句柄.

After asking someone and after thinking about it, it turns out I was viewing cms pages, and those category layout handle only updates category pages not cms pages, i tested it on a category page and it works fine. so if i want those updates to happen on cms pages, i would have to use cms handles.

这篇关于将local.xml添加到Magento布局目录中,但未应用并且被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆