Tuesday 11 November 2003 11:34:13 am
Hi, [EDIT]: Apparently I was a little bit too quick to post. It hit me that there probably existed an is_logged_in attribute for the current_user, and that was of course correct. What's the best way to find out (in a template) whether a user is logged in or not? I've read about using "current_user" for the fetch function, but that doesn't give me the anonymous user id to compare with. Up until now, I've been using the following in my pagelayout.tpl: {section show=eq($current_user.contentobject_id,$anonymous_user_id)} Though there's no documentation of the variable $anonymous_user_id being passed to pagelayout.tpl, this works like a charm. For the other templates, however, this variable seems to be unavailable. So, what is the best way to detect whether a user is logged in or not? Thanks in advance ! Sincerely,
Eirik Johansen Netmaking AS http://www.netmaking.no/
Sincerely,
Eirik Alfstad Johansen
http://www.netmaking.no/
|