我的搜索栏目前在我的主页(http://www.ashvinrx.com/magento/index.php/)上。块type=“核心/模板”name="top.search“as="topSearch”template=目录搜索/form.mini.phtml“/>”
我想让搜索栏出现在我的‘新产品’页面(http://www.ashvinrx.com/magento/index.php/newproducts).Please帮助)。
发布于 2017-05-16 06:40:33
您也可以在phtml文件中尝试这段代码。
<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('catalogsearch/form.mini.phtml')->tohtml(); ?>发布于 2017-05-15 12:24:53
看起来这是cms页面。
您可以将此代码添加到页面{{block type="core/template" name="top.search" template="catalogsearch/form.mini.phtml"}}中。
搜索栏将出现在该页面上。如果你想在任何特定的地方展示这个,让我知道我会用这个来指导你。
发布于 2022-02-04 14:37:28
对于Magento最新版本,请尝试以下格式:
<?php echo $this>getLayout()createBlock('Magento\Framework\View\Element\Template')->setTemplate('Magento_Search::form.mini.phtml')->toHtml() ?>https://stackoverflow.com/questions/43976667
复制相似问题