我是 magento 的新手。我想将搜索栏从标题移动到主页的中间位置,以便它只显示在主页上。
我在 magento 论坛上阅读了许多相关的答案,但都试图编辑 boxes.css 中的 .mini-search 元素,但不幸的是我在这个文件中没有任何这样的元素。
那么,我该怎么做呢?
最佳答案
您需要在主题的布局文件夹中编辑 catalogsearch.xml
并删除以下行:
<reference name="header">
<block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"/>
</reference>
这将从每个页面的标题中删除它。现在,将其插入您的主页。转到 CMS> 页面下的管理员,然后选择您的主页。将这些行粘贴到内容部分中您希望搜索框出现的任何位置:
{{block type="core/template" name="home.search" as="homeSearch" template="catalogsearch/form.mini.phtml"}}
祝你好运,
京东
关于magento - 从 magento 主页的标题中移动搜索栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5401745/