Please upgrade here. These earlier versions are no longer being updated and have security issues.

Changing header depending on login status

Hi,

I've created a theme on which I'd like the header to change depending on the user's login status. While logged out header A is active, while logged in header B is active. I think the obvious place to do this would be "default.master.tpl" within my theme's folder yet since this is a smarty based template file I was unsuccessful in implementing this functionality. I've tried it using {php} tags but they don't seem do do anything at all.

I wouldn't mind creating a new tag for the changing bits within the header, yet I couldn't figure out how to do this either. I'm sure there's an easy way to get this done. I would be glad for any help you can provide helping me to crack this nut.

Thank you!

Tagged:

Comments

  • KasperKasper Scholar of the Bits Copenhagen Vanilla Staff

    You can do it like this:

    {if $User.SignedIn}
        {* Header to display when logged in *}
    {else}
        {* Header to display when logged out *}
    {/if}
    

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

    UnderDogvrijvlinderfr3em1nd
Sign In or Register to comment.