I need to display a custom customer field at form_additional_info
position in the edit.phtml template.
The default edit.phml contains this instruction:
<?= $block->getChildHtml('form_additional_info') ?>
So, in my custom customer_account_edit.xml file I had:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="customer_edit">
<block class="MagentoFrameworkViewElementTemplate"
name="form_additional_info"
template="Vendor_Core::customer/additionalinfocustomer.phtml"/>
</referenceBlock>
</body>
</page>
however, my custom template is not shown.
By seeing the default customer_account_edit.xml file, this is the content:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="customer_account"/>
<body>
<referenceBlock name="head.components">
<block class="MagentoFrameworkViewElementJsComponents" name="customer_account_edit_head_components" template="Magento_Customer::js/components.phtml"/>
</referenceBlock>
<referenceBlock name="page.main.title">
<action method="setPageTitle">
<argument translate="true" name="title" xsi:type="string">Edit Account Information</argument>
</action>
</referenceBlock>
<referenceContainer name="content">
<block class="MagentoCustomerBlockFormEdit" name="customer_edit" template="Magento_Customer::form/edit.phtml" cacheable="false">
<container name="form.additional.info" as="form_additional_info"/>
</block>
</referenceContainer>
</body>
</page>
So I thought I should reference customer_edit
block and define form.additional.info
block inside, but it did not work.
Any help?