Skip to Content Skip to Menu

Empty fields still show if some field layout is set

  • drijn
  • drijn
  • ONLINE
  • Posts: 21
  • Thanks: 2
  • Karma: 0
  • Add-ons
1 day 19 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: 50149
  • Thanks: 8584
  • Karma: 1469
17 hours 15 minutes 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: 21
  • Thanks: 2
  • Karma: 0
  • Add-ons
15 hours 12 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.

Moderators: beatnantkrileon
Powered by Kunena Forum