[[!+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
Spoke too soon... now it says ’Not logged in’ whether I am or not!
OK, I think I figured it out -- use empty string instead of zero: [[!+modx.user.id:is=``:then=`Not logged in`:else=`Logged in`]]
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.
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.
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