質問

I want to add a user login option to the header of my website with this

I have added

<block type="customer/form_login" name="mini_login" template="customer/form/mini.login.phtml" />

to the app/design/frontend/base/default/layout/page.xml file and

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

to the app/design/frontend/base/default/template/page/html/header.phtml file, but nothing appears. I did add Hello after <?php echo $this->getChildHtml('mini_login') ?> and Hello does appear. I did clear the cache storage, but it still doesn't appear.

Why is the login not showing?

役に立ちましたか?

解決

goto customer.xml(path app/design/frontend/your package/your template/layout) add below tag under <default></default> default tag

<default>
....
    <reference name="header">
                <block type="customer/form_login" name="header_customer_form_mini_login"  template="customer/form/mini.login.phtml"/>
        </reference>
...
</default>

Under call this file under header.phtml using this code <?php echo $this->getChildHtml('header_customer_form_mini_login');?>

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top