Magento设计更新仅替换搜索结果页面上的list.phtml [英] Magento design update to replace list.phtml on search results page only
问题描述
我将如何对Magento进行设计更新,以仅替换搜索结果页面的list.phtml模板?有不止一种方法可以做到吗?如果有一种方法可以像我对单个类别一样通过管理面板进行操作,那将是理想的选择,但是如果没有,那么也可以编辑xml文件.
How would I issue a design update to Magento to replace the list.phtml template only for the search results page? Is there more than one way to do it? It would be ideal if there was a way to do it through the admin panel like I can for individual categories, but if not then editing an xml file is okay too.
推荐答案
您应创建文件:app/design/frontend/YOURPACKAGE/YOURTHEME/layout/local.xml
,其内容为:
You should create the file: app/design/frontend/YOURPACKAGE/YOURTHEME/layout/local.xml
having the content:
<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
<catalogsearch_result_index>
<reference name="search_result_list">
<action method="setTemplate"><template>custom/list.phtml</template></action>
</reference>
</catalogsearch_result_index>
</layout>
并创建您的自定义模板,例如app/design/frontend/YOURPACKAGE/YOURTHEME/template/custom/list.phtml
and to create your custom template like app/design/frontend/YOURPACKAGE/YOURTHEME/template/custom/list.phtml
这篇关于Magento设计更新仅替换搜索结果页面上的list.phtml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!