Skip to content

how to modify phtml file without override

generally, in Magento, .phtml files have $block->getChildHtml(), allowing us to put extra data in the .phtml by adding a child to the layout.
if some .phtml file don’t have such code and we want to put our custom HTML in a specific area, is there an approach to do that?
Because overriding the .phtml file in the module will require frequent updates when the original .phtml file is updated.

I am seeking a way to add $block->getChildHtml(‘custom_block_name’) in the .phtml before it renders.

is there any way to do that?

(for example, I need to add block phtml under the customer name on the registration page.)