Skip to Content Skip to Menu

Empty fields still show if some field layout is set

  • drijn
  • drijn
  • ONLINE
  • Posts: 23
  • Thanks: 3
  • Karma: 0
  • Add-ons
2 days 3 hours ago #343282 by drijn
Hi!
In the config , I chose to NOT show fields when value is empty.
Despite this setting, if for a field I set some layout  at  field > paramaters > layout > Profile Value Layout
let's say for instance:  
Code:
<a href="tel:[value]"><i class="fa fa-phone"></i> [value]</a>
Then although the phone field value is empty for a user, the a tag and phone icon will show.
They should not.
Just reporting :)

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 50159
  • Thanks: 8585
  • Karma: 1469
1 day 1 hour ago #343296 by krileon
That's because the field isn't empty. The layout is part of the fields output. Wrap your layout with an IF substitution so it only applies when there is a value. Example as follows.
Code:
[cb:if value!=""]<a href="tel:[value]"><i class="fa fa-phone"></i> [value]</a>[/cb:if]


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: drijn

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

  • drijn
  • drijn
  • ONLINE
  • Posts: 23
  • Thanks: 3
  • Karma: 0
  • Add-ons
22 hours 59 minutes ago #343301 by drijn
Thank you for your replies. I must be missing something because your suggestion seems to be ignored and the field is not showing although it has a value. The value in the condition always seems to be empty

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 50159
  • Thanks: 8585
  • Karma: 1469
5 hours 16 minutes ago #343306 by krileon
Do you have "Empty Field Text" configured? Try emptying it as well in CB > Configuration > User Profile. It applies when a field has no value.


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.

  • drijn
  • drijn
  • ONLINE
  • Posts: 23
  • Thanks: 3
  • Karma: 0
  • Add-ons
5 hours 1 minute ago #343307 by drijn
No, the issue is with
[cb:if value!=""]
value there is always empty although the field has a value set

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 50159
  • Thanks: 8585
  • Karma: 1469
2 hours 8 minutes ago #343313 by krileon
Try if conditioning against the fields name. Forgot that the layouts have very particular value substitution behavior Example as follows.
Code:
[cb:if cb_phonenumber!=""]<a href="tel:[value]"><i class="fa fa-phone"></i> [value]</a>[/cb:if]


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: drijn

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

Moderators: beatnantkrileon
Powered by Kunena Forum