Miwa
July 14, 2020, 8:09am
1
Hello
I’ve read this link, but I could not solve my problem.
Getting Details of the Logged In User and Binding them to your page
I would like to show “account name” from database when the user logged in, and also “GUEST” when the user is not logged in.
Show/hide doesn’t seem to work for this case. how can I solve this?
Thanks,
Teodor
July 14, 2020, 8:54am
2
You can use ternary operator.
Example:
{{userdetails.data.query1[0].name ? userdetails.data.query1[0].name : 'Guest'}}
Miwa
July 14, 2020, 10:02am
3
Thank you so much, I did this though, even “Guest” doesn’t appear on the side bar.
http://174.138.46.199/signin/
It should be shown like this
Thanks,
Teodor
July 14, 2020, 10:05am
4
Well something is not right with your getuserdata server action … it returns validation messages.
All you need inside it is a security provider and a query filtered by it. No POST vars, no validation etc. please make sure to follow the tutorial.
2 Likes
Miwa
July 14, 2020, 1:36pm
5
Thank you so much, when I copied some server action, I didn’t erase what I didn’t need…the problem is solved!
1 Like