I am using Magento 2.1 and I am trying to add one custom form in catalog page.

I override the catalog_category_view to my custom module

and use this code

 <referenceContainer name="columns.top">
        <container name="category.view.container" htmlTag="div" htmlClass="category-view" after="-">
         <block class="Vendor\Module\Block\Search\Form" name="category.pr" template="Vendor_Module::category/form.phtml">

buts it's not working. is there any other way to do this???

  • Check my answer, you did little mistake in catalog_category_view.xml. Jul 9, 2017 at 16:02

1 Answer 1


Create catalog_category_view.xml and call your custom form block


<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceContainer name="category.view.container">
            <block class="Magento\Framework\View\Element\Template" name="custom.category.form" template="Vendor_Module::category/form.phtml" />

Now create custom form.phtml at



echo "<h1>Test Form on category page</h1>";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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