Forum Discussion

niiiiiiiiiik's avatar
9 years ago

If logged in, print screen name

Hey Folks,

 

I am after a simple snippet of code but don't know how to write it :(

 

What I am looking for is... 

 

if user is anonymous, have text display as "Welcome to the community"

otherwise, if user is logged in, then the text will read "Welcome [Screen Name]"

 

Is there a way to do this?

 

Thanks in advanced!

 

Cheers

 

Nik

  • niiiiiiiiiik - Here it is, lmk if this is what you need.

     

    <#if user.anonymous>
            Welcome to the community
    <#else>
             Welcome ${user.login}
    </#if>