-
- 4,149 Posts
[[!+modx.user.id:is=`0`:then=`Not logged in`:else=`Logged in`]]
shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect |
github |
splittingred.com
-
- 82 Posts
Spoke too soon... now it says ’Not logged in’ whether I am or not!
-
- 82 Posts
OK, I think I figured it out -- use empty string instead of zero: [[!+modx.user.id:is=``:then=`Not logged in`:else=`Logged in`]]
-
- 24,544 Posts
I think this might be more reliable in the front end:
[[!+username:is=`(anonymous)`:then=`Not logged in`:else=`Logged in`]]
Remember that when you’re previewing from the Manager, it won’t necessarily work the way it would for a regular front-end user.
-
- 82 Posts
Either something changed when I moved the site live, or I didn’t test properly, but the ’(anonymous)’ test doesn’t work now, so I went back to testing for empty id.
-
- 138 Posts
We didn´t find a site where it is described how to add a logout-link? How does this link have to look like? Does anybody know this?
Letti