2013-08-27 2 views
0
나는 홈 페이지에서 제품 페이지미니 검색 상자한 미니 검색 상자을 갖고 싶어

에서 여러 "미니 검색 상자"를 생성 내 Magento 1.7.2에이 있습니다.젠토 제품 페이지와 main.page

<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> 

내가에 top.search_main 을 할 수 없습니다 :

이 미니 검색 상자

local.xml에서 다음과 같은

(당연히 내 자신의 템플릿에)이라고합니다 기본 페이지에서 apear ... 참조 이름 = "right"를 써야합니까?

의견이 있으십니까?

답변

2

안녕 사용이 할 수있다는 것입니다 당신이

<review_product_list> <remove name="top.search" /> </review_product_list> 
같은 다른 핸들에서이 블록을 제거하는 catalogsearch.xml 및 제품과 사용자를 넣고 태그이

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

-<reference name="right"> <block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"/> </reference> 교체로 이동하는 데 도움이 홈 페이지의 경우

홈 페이지를 호출하는 방법에 대한 세부 정보가 필요하지만 홈페이지를 방문해보십시오.

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

집에서 pags content 섹션을 admin에서 가져온 다음 페이지에 따른 검색을 위해 CSS를 변경하십시오.

+0

답장을 보내 주셔서 감사합니다 ...! "home.search"를 cms가 아니라 1column.phtml에서 호출하는 방법이 있습니까? 더 많은 프로그래밍 방식으로 호출하고 싶지만 작업을 제안한 내용도 있습니다. 이것에 대한 의견? – kost

+0

@kost 이것을 시도해 보라. getLayout() -> createBlock ('core/template') -> setTemplate ('catalogsearch/form.mini.phtml') -> toHtml(); ?> –

+0

getChildHtml('global_messages') ?> \t \t \t \t \t getChildHtml('content') ?> getLayout()->createBlock('core/template')->setTemplate('catalogsearch/for‌​m.mini.phtml')->toHtml(); ?> \t \t \t \t \t \t \t \t
@Darasanthi이 코드는 1column.phtml입니다. 실행되지 않습니다. – kost