Jump to content

Login/logout in Top Horizontal Menu


Recommended Posts

Hi!

I want to add a login and logout button depending if you are logged in or logged out. 

This function works, but I do not know how to add it in my Menu (see attached file):
 

{if $logged}
    <a href="{$link->getPageLink('index', true, NULL, 'mylogout')}">{l s='Log out' mod='blockuserinfo'}</a>
{else}
    <a href="{$link->getPageLink('my-account', true)}">{l s='Login' mod='blockuserinfo'}</a>
{/if}

In the menu it says:

Products - About us - Contact - Log in (I want to change the login to log out if you are logged in an vice versa)

Thank you for your support! 

post-1015994-0-20564900-1437163398_thumb.png

Link to comment
Share on other sites

Is that the default top horizontal menu, with different styling? Or another module?

If it is, theme folder, modules, blocktopmenu, amend the tpl there

Hi, Nemo!

 

Thank you for your respond. 

 

It is the default, but with a styled front end. 

 

Great, I will try that. 

 

Thank you!

Link to comment
Share on other sites

  • 3 months later...
Hello!

 

first of all, sorry for my English  :)

 

I've pasted the code in:

 

themes / default-bootstrap / modules / blocktopmenu / blocktopmenu.tpl

 

 

but the "Login" leaves very little as it is in Picture 1

and I want to leave as in Picture 2 (if possible, with another color box included) ...

 

 

not if anyone could give me lights as I can do

 

 

Thank you!!

 

     

post-775925-0-09538000-1445923489_thumb.jpg

post-775925-0-44807900-1445923499_thumb.jpg

Link to comment
Share on other sites

  • 8 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...