views:

566

answers:

2

How do I use mini login in header of magento? I'd also like the login form to be disabled after login.

A: 

Check in the .phtml files under app/Mage/default/default/templates/page or something like that. Look for where the code is output, and find a hook you can use to determine if the user has signed in. Here is some psuedo PHP

<?php if ( ! $user->signedIn()): ?>
<div id="sign-in-form"></div>
<?php endif; ?>
alex
<?php if ( ! $user->signedIn()): ?><div id="sign-in-form"></div><?php endif; ?>but when i use this code there is giving an error.
plz check the code again and help me.
That code is psuedo code... it describes the logic behind what you need to accomplish.
alex
A: 

layout/costumer.xml

this trick adds login form to left column instead of link in top menu

 <customer_logged_out>
        <reference name="top.links">
        </reference>
        <reference name="left">
        <block type="customer/form_login" name="mini_login" template="customer/form/mini.login.phtml" /> 
         </reference>
        <remove name="wishlist_sidebar"></remove>
        <remove name="reorder"></remove>
    </customer_logged_out>

so if you've got reference in header than change name attribute, is there another way to do it?

Fivell