Question

In Magento, I'm trying to implement a search box to the right of breadcrumbs for easy searching from any internal page.

I have seen tutorials for adding a (top) search form to the header, but breadcrumbs aren't in the header...

Some things I have tried include adding echo $this->getChildHtml('newSearch'); where I would like breadcrumbs to show up, having a newSearch.phtml in my theme's categorysearch folder, and adding <block type="core/template" name="new.search" as="newSearch" template="catalogsearch/newSearch.phtml" /> to my page.xml to attempt to register it.

Good documentation for Magento theming is very hard to come by, and any help is greatly appreciated, even if it's a book or set of docs. :)

Was it helpful?

Solution

I think you had it right:

  • Copy the mini search .phtml file (to your theme or base/default), giving it a new name
  • Adding the block declaration to your page.xml (or theme/layout/local.xml)
  • Depending on where the block is, adding a 'getChildHtml' in the page template

However, that 'newSearch' name is camel case which is not what is generally done for .phtml files (they are all lower case in the standard install).

'newSearch' expands out to 'new/search' when un-camelCased. Try using a different name without camelCase, e.g. just 'search.phtml'. That won't randomly become something else.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top