0

I need to add below block (my custom moudule) to <referenceContainer name="content"></referenceContainer>strictly, but the target template (third-party module) is created via plugin and controller as I found and there is no xml file for it . How to add below block to it?

<referenceContainer name="content">
            <block class="MyVendor\MyCustomModule\Block\Product\Map"
                   name="map"
                   as="stores_map"
                   template="MyVendor_MyCustomModule::product/view/map.phtml"/>
</referenceContainer>

Below is the target template in controller:

$customProducts = $layout->createBlock(
            \ThirdpartyVendor\ThirdpartyModule\Block\Products::class, 'bottom_products', [
                'data' => [
                    'bottom_products' => "$response",
                    'action_name' => $actionName
                ]
            ]
        )->setData('area', 'frontend')->setTemplate('ThirdpartyVendor_ThirdpartyModulen::products/bottomproducts.phtml');
  • I'm not sure I get it. Just to clarify, you need to add products/bottomproducts.phtml to container "content"? And product/view/map.phtml is just for example how would you like to do it? – Stepan Furman Feb 28 '18 at 7:08
  • bottomproducts.phtml is in third-party module, and my block need to be added in content container of it, which does not have and i need to create it I suppose – Zinat Feb 28 '18 at 7:09

Your Answer

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

Browse other questions tagged or ask your own question.