8 – Not able to include the template with the custom form to the other template

Created a custom form and render this form to an custom block(DrupalmymodulePluginBlock)


  public function build() {
    return (
      '#theme'                => 'product_search_block_template',
      '#product_search_block' => Drupal::formBuilder()->getForm('DrupalmymoduleFormProductListFormsProductSearchForm'),

And form elements are returned to “product-search-block-template.html.twig” (working fine).


<div class="productsearch">
    {{ product_search_block }}

But if I include this template to the already existing template “product-list-template.html.twig”,
all the HTML elements from the “product-search-block-template.html.twig” template got included expect the “ProductSearchForm”


<div class="products_list_wrap">
    <div class="prod_search_block">
        {% include '@mymodule/product-search-block-template.html.twig' %}
    <div class="prod_list">
        Product list content goes here...