#StackBounty: #layout #static-block #magento2.3.4 #color-swatches show child block under static block in home page in magento 2

Bounty: 100

I want to show color swatches of configurable product in home page
But My all static blocks in cms page.
Here is my static block

{{block class="SmartwaveFilterproductsBlockHomeLatestList" name="latest" aspect_ratio="1" column_count="6" product_count="12" image_width="212" product_type="3" template="grid.phtml"}}

Here is my layout xml code which is working fine to display color swatches in home page but I want to show convert body part in static block.
Should I use addchild() method in LatestList block file ? If yes how ?

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
      <head>
           <css src="Magento_Swatches::css/swatches.css"/>
    </head> 
    <body>
        <referenceBlock name="homepage.swatchrenderer">
                <block class="MagentoSwatchesBlockProductRendererListingConfigurable" as="configurable" template="Magento_Swatches::product/listing/renderer.phtml" />
        </referenceBlock>     

        <referenceContainer name="main">
          <container name="topproduct" htmlTag="div" htmlClass="topproduct">
                  <block class="SmartwaveFilterproductsBlockHomeLatestList" name="productlist" template="Smartwave_Filterproducts::grid.phtml">
                      <block class="MagentoFrameworkViewElementRendererList" name="homepage.swatchrenderer" as="homepage.toprenderers">
                        <block class="MagentoFrameworkViewElementTemplate" as="default"/>
                      </block>
                  </block>
           </container>
        </referenceContainer>
    </body>
</page>


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.