Move search bar from header in home page in magento

穿精又带淫゛_ 提交于 2019-12-10 17:44:29

问题


I am a new to magento. I wanted to move the search bar from the header to the middle position on home page so that it displays only on the home page.

I've read many related answers on the magento forum but all are trying to edit .mini-search element in boxes.css but unfortunately I don't have any such element in this file.

So, how can I do this?


回答1:


you need to edit catalogsearch.xml in your theme's layout folder and delete the following lines:

<reference name="header">
     <block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"/>
 </reference>

That will remove it from the header of every page. Now, to insert it into your homepage. Go to the admin under CMS>Pages and select your Home Page. Paste the lines into the Content section wherever you want the search box to appear:

{{block type="core/template" name="home.search" as="homeSearch" template="catalogsearch/form.mini.phtml"}}

Good luck,
JD



来源:https://stackoverflow.com/questions/5401745/move-search-bar-from-header-in-home-page-in-magento

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