Question

<reference name="content">
        <block type="customer/form_register" name="customer_form_register" template="customer/form/register.phtml">
            <block type="page/html_wrapper" name="customer.form.register.fields.before" as="form_fields_before" translate="label">
                <label>Form Fields Before</label>
            </block>
        </block>
</reference>

My qustion is what is customer.form.register.fields.before and why this block add in <customer_account_create> And

<?php echo $this->getChildHtml('form_fields_before')?>

what this code show in Phtml page.

Was it helpful?

Solution

By default this does nothing.
But it's there so you can add custom data before the register fields.
It acts like a container where you can put your stuff only by using the layout files.
Let's say you have this in one of your layouts.

<customer_account_create>
    <reference name="customer.form.register.fields.before">
        <block type="[module]/block_name" template="some/template.phtml" name="some_name" as="some_alias" />
    </reference>
</customer_account_create>

Then the block [module]/block_name will be rendered by the template some/template.phtml above the registration fields without any change to the customer register template itself/

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top