My first instinct was to just remove this block from the header block and put it by it self. I figured then I could call it seperately inside of the 3columns.phtml file wherever I wanted using:
<?=$this->getChildHtml('topSearch')?>
This however does not work.... I know I’m missing something simple… but what is it
Moshe said that they may change the method that gets the HTML of the child block. Personally, I haven’t been able to get an HTML block’s HTML to render without using Adam’s above code. Moshe mentioned that they may change this to simply getBlockHtml() which I would highly suggest. Your average designer wouldn’t know to use <?=$this->getLayout()->getBlock('top.search')->toHtml()?> and is probably already daunted by use of the XML blocks, and the associated learning curve of them right from the start.
I am modifying the modern template and having trouble removing the search from the cookie-crumbs line:
I have figured out how (from this thread) to get the search into the upper portion of the header, but I cannot find where
in the xml files to remove the lower duplicated search. See screen capture.
Note that I am using the new 1.4.0.1 magento and the updated modern template for 1.4.0.1.
so you’ll be able to put the search bar anywhere in your template.
Worked a treat, ta
This works but I would like to know why using the getBlock statement is better than using getChildHtml? Does one perform better than the other? What are the advantages and disadvantages? Thanks in advance!
@Primary Numbers You need to open catalogsearch.xml in the layout and change the following:
Is there a way of removing the Search Box from the header through the XML layout mechanism without removing it entirely? I want to move the search box to the footer and have used the following:
which displays the box in the footer, but if I now try to remove it from the header with:
<reference name="header">
<remove name="top.search"/>
</reference>
it removes both the search box in the footer as well as the one in the header. Is it necessary to hack the template file (page/html/header.phtml) to remove the following method call:
$this->getChildHtml(’topSearch’)
to achieve what I want or can it be done more elegantly with an XML instruction?