The Magento login menu item registers the onclick() event to toggle the login form:
<div id="member-title-bg" class="member-title-bg">
<div id="member-title-bg-st"><a href="javascript:void(0);" style="font-weight:normal;font-size:12px;" onclick="toggleMemberMenu('2');">Login</a></div>
</div>
Then the login form itself is wrapped in this div:
<div class="login-menu" id="mMenu" style="display:none;">
. . . login form here
</.div>
Then its display is toggled with this javascript:
<script type="text/javascript">
<!--
var rating_url = 'http://www.magentocommerce.com/';
function toggleMemberMenu(flag){
var menuContainer = document.getElementById("mMenu");
var titleBg = document.getElementById("member-title-bg");
var bgStart = document.getElementById("member-title-bg-st");
if(menuContainer.style.display == "none") {
menuContainer.style.display = "block";
titleBg.className = "member-title-bg" + flag + "-hov";
bgStart.className = "member-title-bg-st-hov";
}else{
menuContainer.style.display = "none";
titleBg.className = "member-title-bg";
bgStart.className = "";
}
}
//-->
You can see this yourself if you visit the site an do a "view source" in your browser.
You probably need some adjustments to your CSS to accommodate the drop-down, but I don’t know what they would be.
BTW, The drop-down doesn’t work at all for me in IE7 Vista.
When i login with an user account the "welcome.. etc." information is displayed inside the loginform’s div rather than replacing my custom "Login" button... this is pretty standard behavior i guess; webloginpe swaps the loginform with the welcome form... only in my case this is not what i want, and this might be quite difficult to change, at least im not sure how to do this.
EDIT: fixed this by adding all the code, except js of course, to the chunk rather than my template, don’t know why i did not think of that before..
Quote from: norlin at May 06, 2009, 12:36 PM
When i login with an user account the "welcome.. etc." information is displayed inside the loginform’s div rather than replacing my custom "Login" button... this is pretty standard behavior i guess; webloginpe swaps the loginform with the welcome form... only in my case this is not what i want, and this might be quite difficult to change, at least im not sure how to do this.
EDIT: fixed this by adding all the code, except js of course, to the chunk rather than my template, don’t know why i did not think of that before..
BTW, JS can go in a chunk, although if you need it in the <head> section, you need to put it in a snippet with $modx->regClientStartupScript() and put the snippet call in the chunk.
Would be nice to do it onMouseOver instead than onMouseClick!!
Website: www.mercologia.com
MODX Revo Tutorials: www.modxperience.com
MODX Professional Partner