I cannot figure out how I can add placeholder for some custom attribute on create account page.

In this file: view/frontend/templates/customer/form/register.phtml i see some code which output html for my attribute:

    <?php $customerAttributes = $block->getChildBlock('customer_form_user_attributes');?>
    <?php if ($customerAttributes): ?>
        <?php $customerAttributes->setObject($block->getFormData())
        <?php $block->restoreSessionData($customerAttributes->getMetadataForm());?>
        <?= $customerAttributes->toHtml() ?>
    <?php endif;?>

But how to add the one I need placeholder for my custom attribute I cannot think of and track how this can be done.

Please, help me!

1 Answer 1


Show customer attributes in the customer registration form For showing customer attributes on the registration page, we need to do the following steps:

First, we will add our phtml files to ‘form.additional.info’ reference name using


<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       <referenceContainer name="form.additional.info">
           <block class="Magento\Framework\View\Element\Template"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.