I want to know the file location of

customer.form.register.newsletter`' in `$block->getChildHtml('customer.form.register.newsletter');

I find it difficult to find out the location or files related to it.

  • anywhere code will have coment. <br>ex: /** * Product list toolbar * * @var $block \Magento\Catalog\Block\Product\ProductList\Toolbar */ – xanka Dec 11 '15 at 3:16

you can not find any files related to it because now this section unused, this section allow yourself or developer to add new content or block to this position.

To add new block to this section you can create new xml file name customer_account_create.xml :

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceBlock name="customer.form.register.newsletter">
            <block class="Your_Block_Name" name="name_of_this_block" template="Vendor_Module::file_name.phtml"/>

There is also available a way how to get to know a template location.

These are template path hints.

A page with enabled template path hints will look like: enter image description here

Template path hints can be enabled/disabled in Magento backend:

Stores->Settings->Configuration->Advanced->Developer->Debug section

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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