I am getting same output if I use
referenceContainer
or
referenceBlock
As
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="order_totals"> <block class="VendorName\ModuleName\Block\Sales\Totals" name="fee_amount" as="fee_amount"/> </referenceBlock> </body> </page> And
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_totals"> <block class="VendorName\ModuleName\Block\Sales\Totals" name="fee_amount" as="fee_amount"/> </referenceBlock> </body> </page> Layout File is:
VendorName\ModuleName\view\frontend\layout\sales_order_view.xml I am curious, which is recommended to use. If both can work, then on what specific conditions? I understand basic of container as explained here.