TOPIC:

hide image if empty in list view 2 weeks 4 days ago #249144

  • Topic Author
  • andraspal
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 24
  • Thanks: 0
My question is how to hide image if empty in list view.

I have thiw in item wrap code:
<img src="{webpath}" style="width:200px" />

But this shows broken image if the image field is empty.

Also tried this :
<?php if ($value!=''){  return $value='<img src="./media/contentbuilder/upload/pdf.png">';  } else { return $value;}?>

But this only shows one particular image(pdf.png), not the one in the field value. I am a confused beginner.

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

hide image if empty in list view 2 weeks 4 days ago #249146

  • tihana.krivic's Avatar
  • tihana.krivic
  • Online
  • Moderator
  • Moderator
  • Posts: 1664
  • Karma: 3
  • Thanks: 149
Hi,

The content template creates some code that indicates an empty field will be hidden.
Did try this?

Regards,
Tihana

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

hide image if empty in list view 2 weeks 4 days ago #249178

  • Topic Author
  • andraspal
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 24
  • Thanks: 0
The content template works ok, but this only renders the details view. I need to show various logos in list view, and I'm afraid the content template "hide if" codes don't work in item wrap code in list view.

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

Last edit: Post by andraspal.

hide image if empty in list view 2 weeks 2 days ago #249195

  • tihana.krivic's Avatar
  • tihana.krivic
  • Online
  • Moderator
  • Moderator
  • Posts: 1664
  • Karma: 3
  • Thanks: 149
Hi,

please try this:
<?php if($value != ''){ $value = '<img src=".$value"/>';} ?>

Let me know if it helps

Regards,
Tihana

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

hide image if empty in list view 1 week 5 days ago #249371

  • Topic Author
  • andraspal
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 24
  • Thanks: 0
Well, I tried but to no avail, the image source now look like this: example.com/.$value
But indeed when there is no uploaded image icons are hidden which is a good start.

Field type is upload in the editable column.

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

Last edit: Post by andraspal.

hide image if empty in list view 1 week 5 days ago #249374

  • tihana.krivic's Avatar
  • tihana.krivic
  • Online
  • Moderator
  • Moderator
  • Posts: 1664
  • Karma: 3
  • Thanks: 149
hmm, I am a little confused now
When there is not uploaded image icons are hidden because in content template is set {hide if empty}.

Regards,
Tihana

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

  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.051 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!