0

I want to know the difference between <container> and <referenceContainer> for layout file.

Thank you in advance!

2 Answers 2

0

Container: A structure without content that holds other layout elements such as blocks and containers.

referenceBlock and referenceContainer: Updates in <referenceBlock> and <referenceContainer> are applied to the corresponding <block> or <container>.

For example, if you make a reference by <referenceBlock name="right">, you are targeting the block <block name="right">.

To pass parameters to a block use the <argument></argument> instruction.

Magento Doc

1
  • so that means the referenceContainer/referenceBlock are used to make changes in Container/ Block. the name is mentioned in the name attribute of referenceContainer/referenceBlock? right? Nov 9, 2021 at 12:25
0

Container

A structure without content that holds other layout elements such as blocks and containers.

A container renders child elements during view output generation. It can be empty or it can contain an arbitrary set of <container> and <block> elements.

referenceContaine

Updates in <referenceContainer> are applied to the corresponding <container>.

In otherwork we can said that, if you want make any changes into the particular Container at that time you can use there refrence.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.