I have set template using the following code
$this->getLayout()->createBlock('core/template')->setTemplate('catalogsearch/form.mini.phtml')->toHtml();
This calls the template file from the following folder frontend/base/default/template/catalogsearch/form.mini.phtml
.
How can I call this from my custom theme (i.e.) frontend/customtheme/default/template/catalogsearch/form.mini.phtml
?
Best Answer
if you have configured your
package/theme
correctly in backend (atSystem > Configuration > Design
), then Magento will automatically take your phtml file from yourpackage\theme
if you have defined your phtml file correctly there.Magento uses a callback mechanism to fetching the correct file. It first look for a theme file in the configured
package/theme
directory, then the default theme directory (if any) and at last in thebase/default
directory.So your file is taking from
base/default
directory means, you didnt definedcatalogsearch/form.mini.phtml
in your theme directory correctly. So check again the template file path and then clear the cache.