doucheng9634 2013-08-27 11:56
浏览 39
已采纳

Magento在产品页面和main.page中创建了多个“迷你搜索框”

I want to have one mini-search box in the products page and one mini-search box in the home-page in my Magento 1.7.2.

These mini-search box are called from the local.xml (in my own template ofcourse)

like this below:

    <reference name="left">
             <block type="core/template" name="top.search" template="catalogsearch/form.mini.phtml" after="sibling.blockName"/>
    </reference>

   <reference name="right">
             <block type="core/template" name="top.search_main" template="catalogsearch/form.mini_main.phtml" after="sibling.blockName"/>
   </reference>

I cannot make the top.search_main to apear in the main page... How should I write the reference name="right" ?

Any suggestion ?

  • 写回答

1条回答 默认 最新

  • doupao2277 2013-08-27 13:31
    关注

    hi use this may it will helps you go to catalogsearch.xml and replace with this

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

    to <reference name="right"> <block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"/> </reference> for product and user bellow tag to remove this block from different handles like

     <review_product_list> <remove name="top.search" /> </review_product_list> 
    

    for home page i need details how you calling the home page, but try this for home page

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

    put it on home pags content section from admin and than change the css for search according to the page

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?