magento - 从 magento 主页的标题中移动搜索栏

标签 magento search header webpage

我是 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/

相关文章:

magento - Magento Redis CPU使用率高redis-rdb-bgsave

php - 在 Magento 中更改措辞 "Special Price"和 "Regular Price"

regex - 将 domain.tld/index.php 重定向到 domain.tld(删除 index.php,然后删除 301)

sql - 搜索长 varchar SQL

c++ - 最佳默认 header 名称?

css - 无法让 Z-index 将::after background 放在同一个 div 的背景下。这可能吗?

html - 在 magento 中找不到版权信息

search - 在 VIM 搜索和替换中使用退格键

search - 我如何找到 secret 的 mercurial 修订版?

php - 如何确定压缩文件的内容长度?