[SOLVED] {if} tag for logged in status?
johnnaked
Joined: 2004-11-30
Posts: 5 |
Posted: Tue, 2004-11-30 23:32 |
I was curious as to if there was an {if} tag I could throw in the templates to display certain things only if you were logged in. |
|
Posts: 808
I'm not a 100% sure but I think this is it.
Posts: 8601
good guess, but that is set when the login form on the sidebar will be shown (so it kinda could work, if it's set then you're not logged in)
we don't have anything specifically for that, but here's something that should be reliable, as long as you don't change the username for your guest user:
{if $layout.user.userName != 'guest'}
Posts: 5
It doesn't look like that will do it for me.
Right now I've got:
I'm trying to make sure that the action select beneath photos and albums only shows up if you are logged in. As of now, it doesn't show up either way.
Posts: 8601
looks like you tried the first suggestion.. hmm..
Posts: 5
Ah! I replied prior to refreshing the page.
That's working perfectly, thanks mindless.
Posts: 8601
I have made a standard template variable so user info is available to every view. You can reference these in any tpl: $user.userName, $user.fullName, $user.isGuest, $user.isRegisteredUser, $user.isAdmin
Update from cvs in a few hours or get tomorrow's nightly snapshot to try this out. If you have any references to $layout.user in your local tpl files you'll need to change these to just $user.