0

magento中,我正在编写一个模块。在我的模块中,假设我mymodule.xml想在这个块之后插入我自己的块

<catalog_product_view>
    <reference name="product.info">
      <block type="test/test" name="test" as="other" template="test/test.phtml" >
        <block type="test/test" name="test_info" as="test_info" template="test/testinfo.phtml" />
      </block>
    </reference>
  </catalog_product_view>

这个工作正常,product details view page但是当我试图显示相同的块时,product category view and list view它根本不工作。产品列表类别是这样的,我从中插入代码mymodule.xml

    <catalog_product_list>
    <reference name="product.info">
       <block type="test/test" name="test" as="other" template="test/test.phtml" >
        <block type="test/test" name="test_info" as="test_info" template="test/testinfo.phtml" />
      </block>
    </reference>
  </catalog_product_list>

当我要检查列表视图中的更改时,我看不到任何更改(清除缓存后)。所以有人可以告诉我如何解决这个问题。任何帮助和建议都将是非常可观的。谢谢..

4

1 回答 1

0

那么,您在类别页面(列表页面)中使用的 xml 代码不正确。它应该是这样的:

<catalog_category_default>
<reference name="category.products">
    <block type="test/test" name="test" as="other" template="test/test.phtml" >
        <block type="test/test" name="test_info" as="test_info" template="test/testinfo.phtml" />
    </block>
</reference></catalog_category_default>

<catalog_category_layered>
<reference name="category.products">
   <block type="test/test" name="test" as="other" template="test/test.phtml" >
    <block type="test/test" name="test_info" as="test_info" template="test/testinfo.phtml" />
  </block>
</reference>  </catalog_category_layered>

请尝试一下。而且,如果还有什么,请与我联系。谢谢。

于 2013-09-06T18:23:26.090 回答