Hide Tab and fields when empty not working after update

7 years 2 months ago #291731 by Mx150
Hi CB Team,

i now done the brand new update of community builder and everything works good, even my old plugins. That is great because i soon want to buy the paided version.

But i have a problem with the update. Since i have done it with no errors, empty fields are showing in CB Profil.
Of cause i have switched "Hide empty field" on

I use newst joomla version and newest CB

It also happens when i use custom profil Layout for fields. Like adding [value] to profil view field layout.

Hope that anyone can help me.



Greetings

Please Log in to join the conversation.

7 years 2 months ago #291903 by Mx150
Hi CB Team,

i dont get it with this problem. I have anything in cofiguration turned off.

Hide empty field and
Hide empty tabs

But the Field is and tab are still visible in profil but they are empty. I now finde this to forum post

www.joomlapolis.com/forum/153-professional-member-support/177927-solved-cb-tabs-hide-tab-depending-on-cbfield-value
www.joomlapolis.com/forum/146-general/159743-hide-tab-when-empty

But even this help doesnt work for me.
I use my example field to let the user add her Facebook link. The field is called cb_facebook and i use the following code under Parameter -> Profillayout

<div align="left"><img style="float: left;margin-right: 10px;" src="/images/sampledata/facebook_32.png"><font size="2"><a href="http://[value]" target="_blank">[username]<br/>auf Facebook</a></font></div>

This worked perfekt bevor the update.
I tried to unpublish any plugin one by one to maybe finde a error that happens but i found nothing. Fields are still displaying even if they are empty.

If i look at my profil html it looks like this.

<div class="cb_field col-sm-12">
<div id="cbfv_94">
<div align="left"><img style="float: left;margin-right: 10px;" src="/images/sampledata/facebook_32.png"><font size="2"><a href="http://" target="_blank">Deko-tu<br>auf Facebook</a></font></div>
</div>
</div>

As you can see is the value empty but the field stil displaying... Hope anybody can help me with this. I dont know what i can try to get this to work. My only solution would be adding a class with display:none for emty field. But i think this should work somehow without going the class way.

Many Greetings

Please Log in to join the conversation.

7 years 2 months ago #291937 by krileon
It's still displaying because you're overriding its display with a layout and adding HTML to its output making it never empty. Add an IF substitution condition to ensure the field even has a value before altering its display. Example as follows.

[cb:if FIELD_NAME_HERE!=""]YOUR_HTML_HERE[/cb:if]

See the below substitution tutorial for further usage information.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.312 seconds

Facebook Twitter LinkedIn