Skip to Content Skip to Menu

🌟Discover the Joomla AI Plugin that wrote its own story! - CB Editor Assistant 1.1now for Joomla 3, 4 & 5!
✍️ 5-Day Free Trial, then 🎯 save up to 30% with our 🛍️ Intro Offer (First 50 users, ends Dec. 31)
🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

Hide Tab and fields when empty not working after update

  • Mx150
  • Mx150
  • OFFLINE
  • Posts: 45
  • Thanks: 4
  • Karma: 1
7 years 10 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 or Create an account to join the conversation.

  • Mx150
  • Mx150
  • OFFLINE
  • Posts: 45
  • Thanks: 4
  • Karma: 1
7 years 10 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 or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48630
  • Thanks: 8307
  • Karma: 1446
7 years 9 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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum