I am trying to replace the
customer.login.container on the login page, which can be done through
customer_account_login.xml by adding something like:
<referenceContainer name="customer.login.container" remove="true" />
However, I need to set a config condition (similar to
ifconfig for blocks), where I will remove this container if a certain config is true, and replace it with another container/blocks. If the config is false, the original page should remain untouched.
I have tried overriding the
toHtml method in the login class, but get strange results and it's probably not the best way to do this. Is it possible to do this through the XML files alone? If not, what's the most harmless way to intervene here without removing existing Magento functionality or creating an observer / any kind of action that waits for the original container to load and only then makes changes?