magento中的两种产品布局

magento中的两种产品布局,magento,layout,product,Magento,Layout,Product,在magento项目中,我有四个类别和两个产品模板文件 像 1) 目录/产品/视图.phtml(原件) 2) catalog/product/newview.phtml(新文件) 现在我想显示基于类别的产品布局 与类别id 1和2一样,产品显示基于view.phtml 以及类别3和类别4,基于newview的产品显示。phtml您可以在“设计”选项卡集中的后端中的每个产品上设置: <reference name="product.info"> <action meth

在magento项目中,我有四个类别和两个产品模板文件

1) 目录/产品/视图.phtml(原件)

2) catalog/product/newview.phtml(新文件)

现在我想显示基于类别的产品布局

与类别id 1和2一样,产品显示基于view.phtml


以及类别3和类别4,基于newview的产品显示。phtml

您可以在“设计”选项卡集中的后端中的每个产品上设置:

<reference name="product.info">
     <action method="setTemplate"><template>catalog/product/newview.phtml</template></action>
</reference>

使用此代码根据local.xml文件中的类别id进行显示

      <reference name="product_list">
          <action method="setTemplate"><name>catalog/product/list_new.phtml</name></action>
      </reference>
 </CATEGORY_5>


目录/产品/列表\u new.phtml

您能告诉我这是添加观察值的正确方法吗?local(dir)->Mage(dir)->Catalog(dir)==Modal(dir)->Observer.php(File)==etc(dir)->config.xml===Observer.php===class Mage_Catalog\u Model\u Observer{public function generateBlocksAfter($event){…}==config.xml==。。。。我建议您在自己的模块中设置此项,而不是在Mage_目录中,但是的,这似乎是正确的方法
      <reference name="product_list">
          <action method="setTemplate"><name>catalog/product/list_new.phtml</name></action>
      </reference>
 </CATEGORY_5>