1

I want to add the search bar in my 404 cms page. So I've written in the content of it :

{{block type="Magento\Framework\View\Element\Template" template="Magento_Search::form.mini.phtml"}}

But it doesn't shows anything. I've showed the templates hints and I I know that the location of the search bar template is in this location :

vendor/magento/module-search/view/frontend/templates/form.mini.phtml

So I don't know why my solution doesn't work. Can you help me please ?

3

change type to class

{{block class="Magento\Framework\View\Element\Template" template="Magento_Search::form.mini.phtml"}}
  • i need to include search in my custom module template file. how that can be done? – jafar pinjar Dec 31 '18 at 11:11
  • @jafarpinjar blog.qaisarsatti.com/magento_2/… – Qaisar Satti Dec 31 '18 at 11:14
  • hi @Qaisar, I have added template file in my custom module, search bar is working if added in cms, but i need to load search bar in same template file of my module. how it can be added – jafar pinjar Dec 31 '18 at 11:16
  • @jafarpinjar open link and read there is solution to call it directly in phtml file. – Qaisar Satti Dec 31 '18 at 11:18
  • hi @Qaisar, my question is different, i am not including my template in other phtml, i am looking for code how to include default search bar form in my custom module template file – jafar pinjar Dec 31 '18 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.