如何将搜索栏从主页调用到 Magento 1.9 中的所有其他页面?
How to call the Search bar from homepage to all other pages in Magento 1.9?
我的搜索栏目前在我的主页上 (http://www.ashvinrx.com/magento/index.php/)。
块类型="core/template" 名称="top.search" as="topSearch" 模板="catalogsearch/form.mini.phtml"/>
我想让搜索栏出现在我的 'newproducts' 页面上(http://www.ashvinrx.com/magento/index.php/newproducts).Please 帮助。
看起来这是cms页面。
您可以在该页面中添加此代码{{block type="core/template" name="top.search" template="catalogsearch/form.mini.phtml"}}
搜索栏将出现在该页面上。如果您想在任何特定位置显示它,请告诉我,我会指导您。
您也可以在 phtml 文件中尝试此代码。
<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('catalogsearch/form.mini.phtml')->tohtml(); ?>
对于 Magento 的最新版本,请尝试以下格式:
<?php echo $this>getLayout()createBlock('Magento\Framework\View\Element\Template')->setTemplate('Magento_Search::form.mini.phtml')->toHtml() ?>
我的搜索栏目前在我的主页上 (http://www.ashvinrx.com/magento/index.php/)。 块类型="core/template" 名称="top.search" as="topSearch" 模板="catalogsearch/form.mini.phtml"/>
我想让搜索栏出现在我的 'newproducts' 页面上(http://www.ashvinrx.com/magento/index.php/newproducts).Please 帮助。
看起来这是cms页面。
您可以在该页面中添加此代码{{block type="core/template" name="top.search" template="catalogsearch/form.mini.phtml"}}
搜索栏将出现在该页面上。如果您想在任何特定位置显示它,请告诉我,我会指导您。
您也可以在 phtml 文件中尝试此代码。
<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('catalogsearch/form.mini.phtml')->tohtml(); ?>
对于 Magento 的最新版本,请尝试以下格式:
<?php echo $this>getLayout()createBlock('Magento\Framework\View\Element\Template')->setTemplate('Magento_Search::form.mini.phtml')->toHtml() ?>