添加迷你登录页面标题

时间:2014-04-22 13:46:07

标签: magento magento-1.8

我想使用this

在我的网站标题中添加用户登录选项

我添加了

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

app/design/frontend/base/default/layout/page.xml文件和

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

app/design/frontend/base/default/template/page/html/header.phtml文件,但没有出现。我确实在Hello之后添加了<?php echo $this->getChildHtml('mini_login') ?>,并且Hello确实出现了。我确实清除了缓存存储,但它仍然没有出现。

为什么登录没有显示?

1 个答案:

答案 0 :(得分:6)

转到customer.xml(路径app / design / frontend /您的包/您的模板/布局)在<default></default>默认标记

下添加以下标记
<default>
....
    <reference name="header">
                <block type="customer/form_login" name="header_customer_form_mini_login"  template="customer/form/mini.login.phtml"/>
        </reference>
...
</default>

使用此代码header.phtml

<?php echo $this->getChildHtml('header_customer_form_mini_login');?>下调用此文件
相关问题