本文主要是介绍magento 通过layout文件 实现 block之间通信,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
可以参考 搜索模块
<catalogsearch_result_index translate="label"><label>Quick Search Form</label><reference name="root"><action method="setTemplate"><template>page/2columns-left.phtml</template></action></reference><reference name="left"><block type="catalogsearch/layer" name="catalogsearch.leftnav" after="catalog.topnav2" template="catalog/layer/view.phtml"/></reference><reference name="content"><block type="<span style="color:#ff0000;">catalogsearch/result</span>" name="search.result" template="catalogsearch/result.phtml"><block type="<span style="color:#ff0000;">catalog/product_list</span>" name="search_result_list" template="catalog/product/list.phtml"><block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml"><block type="page/html_pager" name="product_list_toolbar_pager"/></block><action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action><action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action><action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action><action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action><action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action><action method="setToolbarBlockName"><name>product_list_toolbar</name></action><action method="setColumnCount"><columns>3</columns></action></block><action method="setListOrders"/><action method="setListModes"/><action method="setListCollection"/></block></reference></catalogsearch_result_index>
通过此配置 可以实现 Result Block 调用Product list Block 方法
这篇关于magento 通过layout文件 实现 block之间通信的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!