Try the Demo

Magento

eCommerce Software for Online Growth

Magento Forum

Our new hosted solution for small & emerging businesses
   
Move search bar in modern theme 1.4.1.1
 
DrWho
Jr. Member
 
Total Posts:  9
Joined:  2008-12-01
 

header.phtml includes the code

<?php echo $this->getChildHtml('topBar'?>
which calls both the breadcrumbs and the catalogue search. I have found the file breadcrumbs.phtml and form-mini.phtml (the file that contains the catalogue search) but haven’t managed to figure out how both these files are called using
<?php echo $this->getChildHtml('topBar'?>

Can anyone help explain this please?

The reason I ask is that I want to move the search box above the top navigation while keeping the breadcrumbs where they are. Moving

<?php echo $this->getChildHtml('topBar'?>
within header.phtml moves them both.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Magento Exp
Member
 
Total Posts:  37
Joined:  2010-08-03
 

Do you really want to delete the search box at the top of every page?

 
Magento Community Magento Community
Magento Community
Magento Community
 
DrWho
Jr. Member
 
Total Posts:  9
Joined:  2008-12-01
 

No. I want to move it independantly of the breadcrumbs.

 
Magento Community Magento Community
Magento Community
Magento Community
 
satish
Guru
 
Total Posts:  671
Joined:  2008-03-24
210,Tanga stand,Dharampeth,Nagpur,MS,India 440010
 

You should check layout xml where that “topBar” template is define . If you will see below code
<block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"/>
Remove that block part which refer to “catalogsearch/form.mini.phtml” search box, and define where you want or you can go with default.

<?php echo $this->getChildHtml('topSearch');?>

<block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"/> You place this in xml where You want to display the search.

explanation: php echo $this->getChildHtml(’topSearch’); call for topSearch child.
as we have defined it using <block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"/>
so it will consider this block code and map it with form/mini.phtml

Satish

 Signature 

Customize Magento: http://www.oscprofessionals.com/oscommerce/magento-customization.html
Blog : http://www.oscprofessionals.com/blog
Multistore Demo(website) : http://www.oscprofessionals.com/oscommerce/multistore-magento.html
Multistore Demo (store): http://www.oscprofessionals.com/oscommerce/magento-share-cart-for-multistore.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brian2
Member
 
Total Posts:  59
Joined:  2009-01-12
Harrogate, North Yourshire, UK
 

This can be acheived by making 2 changes as follows:

First edit catalogsearch.xml by changing “top.bar” to “header”.

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

Them add the following to the header div within header.phtml.

<?php echo $this->getChildHtml('topSearch'?>

 Signature 

Magento Themes

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nami
Jr. Member
 
Total Posts:  3
Joined:  2010-06-02
 

I’m trying the same except I’m trying to get the search bar in the horizontal top navigation bar.

I’ve changed:

<reference name="header">
to:
<reference name="top">
in the catalogsearch.xml file

and moved:

<?php  echo $this->getChildHtml('topSearch'?>
out of header.phtml and into top.phtml

No success. Am I missing something?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
© Copyright 2012 Magento Inc.
Privacy Policy|Terms of Service
Magento Community Count
704132 users|1586 users currently online|499591 forum posts