2

So I have slightly modified the customer.xml file to add classes to the top links, so I could add font awesome icons to them. The issue I am having is for some reason the login class disappears if I click on the login link, then without actually logging in, click back to the home page, the class on the login link get removed!

<reference name="top.links">
        <action method="addLink" translate="label title" module="customer">
            <label>Login</label>
            <url helper="customer/getLoginUrl"/>
            <title>Login</title>
            <prepare/>
            <urlParams/>
            <position>12</position>
            <liParams>
                <class>toplinks-login</class>
            </liParams>
            <aParams>
                <class>toplinks-login-a</class>
            </aParams>
            <beforeText/>
            <afterText/>
        </action>
    </reference>

This is the code I have for the login. So when the problem happens the "toplinks-login-a" class disappears and no class is shown at all.

I have searched for hours and can't find out why this could happen. Does anyone know another alternate way to add a class, perhaps hardcoding it?

EDIT: This is what the HTML looks like when the page loads correctly

<a href="http://website.com/customer/account/login/referer/aHR0cDovL2Rldi5uYXVnaHR5Y292ZS5jb20vbWFzdHVyYmF0b3JzLmh0bWw,/" title="Login" class="toplinks-login-a">Login</a>

And when it doesn't work randomly

<a href="http://website.com/customer/account/login/referer/aHR0cDovL2Rldi5uYXVnaHR5Y292ZS5jb20v/" title="http://website.com/customer/account/login/referer/aHR0cDovL2Rldi5uYXVnaHR5Y292ZS5jb20v/">Log In</a>
2

add them like this <liParams>class="toplinks-login"</liParams><aParams>class="toplinks-login-a"</aParams>

 <reference name="top.links">
            <action method="addLink" translate="label title" module="customer">
                <label>Login</label>
                <url helper="customer/getLoginUrl"/>
                <title>Login</title>
                <prepare/>
                <urlParams/>
                <position>12</position>
    <liParams>class="toplinks-login"</liParams>
    <aParams>class="toplinks-login-a"</aParams>
    <beforeText/>
                <afterText/>
            </action>
        </reference>
  • Thanks for the reply but it still doesn't fix it. The odd thing is I have changed the default "Log In" text to "Login" and when the class disappears it also changes the text back to "Log In". Also after more testing, it seems to just randomly disappear, not just after clicking back off login page. – blackwat3r Dec 16 '15 at 16:50
  • are you using any custom theme? – Qaisar Satti Dec 17 '15 at 5:41
  • I am using a custom theme, but nothing that would override anything to do with the login function, I already checked every theme file. Also, I am using exact same setup on my localhost and my dev server and I don't have this problem on my localhost copy :/ – blackwat3r Dec 17 '15 at 14:30
  • did you tried default theme have a same problem? – Qaisar Satti Dec 17 '15 at 14:44
  • admin -> system ->configuration ->customer configuration tab login option Redirect Customer to Account Dashboard after Logging in set to yes – Qaisar Satti Dec 17 '15 at 14:49

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.