I have created a custom block and tried to insert it multiple times in the same page:
<block class="MyCompanyMyModuleBlockProducttabsCategoryProducts" name="category.products.slider1" template="MyCompany_MyModule::producttabs/category-items-new.phtml">
<arguments>
<argument name="category_id" xsi:type="string">31</argument>
<argument name="block_title" xsi:type="string">Lorem ipsum</argument>
<argument name="block_text" xsi:type="string">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</argument>
</arguments>
</block>
<block class="MyCompanyMyModuleBlockProducttabsCategoryProducts" name="category.products.slider2" template="MyCompany_MyModule::producttabs/category-items-new.phtml">
<arguments>
<argument name="category_id" xsi:type="string">32</argument>
<argument name="block_title" xsi:type="string">Quod autem</argument>
<argument name="block_text" xsi:type="string">Quod autem satis est, eo quicquid accessit, nimium est</argument>
</arguments>
</block>
category-items-new.phtml
should display block arguments:
<h4><?php echo $block->getData('block_title'); ?></h4>
<p><?php echo $block->getData('block_text'); ?></p>
But instead of displaying:
<h4>Lorem ipsum</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<h4><h4>Lorem ipsum</h4>
<p>Quod autem satis est, eo quicquid accessit, nimium est</p></h4>
I’m getting the first block data repeated twice:
<h4>Lorem ipsum</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<h4>Lorem ipsum</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.