Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount! Get 20% off now with code SPOOKY-2024!

field which only appears when you are not logged in

  • smFruen
  • smFruen
  • OFFLINE
  • Posts: 116
  • Thanks: 5
  • Karma: 3
8 years 1 month ago - 8 years 1 month ago #286384 by smFruen
can i make a field which only appears when you are not logged in.

eks.
when you are not logged in, the userlist are show user photo, but I, like showing a html field with a picture,
the picture shows a text ("you must log in to see user photos") that field should not appear when you log in

not-logged-in show the field


logged-in dont show the field
Attachments:
Last edit: 8 years 1 month ago by smFruen.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
8 years 1 month ago #286409 by krileon

can i make a field which only appears when you are not logged in.

Yes, you maybe able to do it with a simple IF substitution in the Profile Value Layout of your field. Example as follows.

[cb:if onlinestatus="0"][value][/cb:if]


If the above doesn't work try !="1", ="false", or !="true" to see if either of those will work. If not then you need to use CB Conditional as follows.

Display: Field conditional self
Field: Custom > Value
Value: [cb:userdata field="onlinestatus" /]
Translate Value: False
Operator: Equal To
Value: false
Translate Value: False
Mode: Show

With the above again you may need to play with the values. The raw substitution should return true if logged in or false if logged out, but can be tricky with the conditions to match booleans in substitutions or conditions and usually need to match 1 or 0.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • smFruen
  • smFruen
  • OFFLINE
  • Posts: 116
  • Thanks: 5
  • Karma: 3
8 years 3 weeks ago #286738 by smFruen
Access Level

guest

then it is only appears when you are not logged in

Works fin

Attachments:

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
8 years 3 weeks ago #286745 by krileon
That'll hide it if the viewing user isn't logged in, but I understood it as you wanted to hide it if the displayed user wasn't logged in.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: smFruen

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum