Magento design update to replace list.phtml on search results page only

柔情痞子 提交于 2019-12-21 23:06:29

问题


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.


回答1:


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>

and to create your custom template like app/design/frontend/YOURPACKAGE/YOURTHEME/template/custom/list.phtml



来源:https://stackoverflow.com/questions/14900291/magento-design-update-to-replace-list-phtml-on-search-results-page-only

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!