Overide block double time in module?

Hello!
I have 2 questions…

First - Can I ovveride double or several times?
For example…

  1. overide block “X” in module A from template flow
  2. overide block “X” in module B from template flow
  3. overide block “X” in module C from template flow
    It should work?

Second
In original flow theme there is a block A inside which there is block B (in INCLUDED tpl file).
and now in module X i was overided block A,
and now in module Y i want to overide block B.
How should looks path in metadata.php in module Y to overide block B?

To visualise:
File order.tpl has block “order_basket” in which there is:
[{include file=“page/checkout/inc/basketcontents.tpl” editable=false}]
and inside this file we have block “checkout_basketcontents_summary”.

In module X I overided block “order_basket”. Now in module Y i want to overide block “checkout_basketcontents_summary”.

Any suggestions?

  1. it will work if you are calling [{$smarty.block.parent}] in your block templates
  2. just the regular way

Thanks @vanilla_thunder but answer: “just the regular way” is not precise enough for me :slight_smile:
Probably because i didn’t write precisely enough too.

I overrided block “order_basket” in module X. In my overrided block i have other file included from other path. Previously it was:
[{include file=“page/checkout/inc/basketcontents.tpl” editable=false}]
but now i have this:
[{include file=“page/checkout/inc/myown_basketcontents.tpl” editable=false}]

In my “myown_basketcontents.tpl” there is allmost the same content as is in original *.tpl file (basketcontents.tpl - with with all original blocks, for example: ‘checkout_basketcontents_summary’).

Soo now if i want to override ‘checkout_basketcontents_summary’ block in module Y, i need to add in metadata path to:
A. original file where is the block: ‘page/checkout/inc/basketcontents.tpl’
B. or from module X? ‘page/checkout/inc/myown_basketcontents.tpl’
C. or from path to: ‘order.tpl’

Thanks for replay!

since “page/checkout/inc/myown_basketcontents.tpl” is your template path + name, this should be the right way

1 Like