I have written a module that has a settings page in the backend. The Module overrides a layout.xml file and uses a modified template by editing my own template path
view/frontend/layout/customer_account_create.xml
in this line of the layout file:
<block class="Magento\Customer\Block\Form\Register" name="customer_form_register" template="form/register.phtml">
But I would like to override this layout file only if the backend settings for this module is set to enabled.
I know I can add some code in the template I override to check for the setting before doing my modifications, but is there another way?