I'm trying to display the (quick) search in the navigation menu.
Here is what I have so far:
catalogsearch.xml
<reference name="header">
<block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"/>
</reference>
top_nav.phtml
<li><?php echo $this->getChildHtml('topSearch') ?></li>
But the search bar isn't showing.
- I've refreshed the caches
- It isn't hidden by CSS, it isn't even showing in the inspector
- I'm working from the right template
What am I doing wrong?
Best Answer
Just change
$this->getChildHtml('topSearch')
to$this->getBlockHtml('topSearch')
OR:
As you call this
searchbox
aschild block
of in top_nav.phtml but you have call in header child block in xml file.So it not comingSo you need to change
reference parent block
of search fromheader
to top_nav.phtml file block.Just like concept:
top_nav.phtml block name is topNav
guess that
then
should be