0

I am using social login plugin that overrides the default customer login form template in this way :

<customer_account_login>
       <reference name="customer_form_login">
            <action method="setTemplate"><template>ced/sociallogin/customer/form/login.phtml</template></action>
            <block type="persistent/form_remember" name="persistent.remember.me" template="persistent/remember_me.phtml" />
            <block type="core/template" name="persistent.remember.me.tooltip" template="persistent/remember_me_tooltip.phtml" />
            <block type="sociallogin/login" name="ced_sociallogin_login">
                <block type="sociallogin/google_button" name="ced_google_login_button" />
                <block type="sociallogin/facebook_button" name="ced_facebook_login_button" />
                <block type="sociallogin/twitter_button" name="ced_twitter_login_button" />
                <block type="sociallogin/linkedin_button" name="ced_linkedin_login_button" />
                <block type="sociallogin/yahoo_button" name="ced_yahoo_login_button" />
            </block>
        </reference>
    </customer_account_login>

Now I am calling this block in another template file like this:

 <?php echo $this->getLayout()->createBlock('customer/form_login')->setTemplate('ced/sociallogin/customer/form/login.phtml')->toHtml(); ?>

This template - "login.phtml" has a small list of child methods called in this way:

<?php echo $this->getChildHtml('form.additional.info'); ?>
<?php echo $this->getChildHtml('persistent.remember.me'); ?>
<?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?>
<?php echo $this->getChildHtml("ced_sociallogin_login"); ?>

But none of them are being called.. Why is this so??

1

Now I am calling this block in another template file like this:

No, you don't. You create a new instance of the block, which knows nothing about the hierarchy in which the existing blocks is located.

The block with its children is created by the XML definition, on the customer login page. If you are on this page, you can retrieve, modify and output the block like this:

 <?php echo $this->getLayout()->getBlock('customer_form_login')->setTemplate('ced/sociallogin/customer/form/login.phtml')->toHtml(); ?>

If you are on a different page, you need to copy the XML to the layout handle for this page first.

| improve this answer | |

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.