Concatenate Fields with IF statement

  • kenryanjr
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 144
  • Thank you received: 0

kenryanjr created the topic: Concatenate Fields with IF statement

I have two fields I would like to concatenate into one.

The first is the column that the data belongs to
<?php $col2170 = 'col2170';$value = '<span class="fa fa-camera">&nbsp;</span>' . $value; ?>

The second field is another column that I would like to have the if statement.
<?php if (empty($value)) { $value='<img src="images/noImage.jpg" alt="No Image Available" class="img-forsale"/>'; } else { $value='<img src="images/forsale/vehicles/'.$value.'"  alt="Photo of Item For Sale" class="img-forsale" />'; } ?>

Problem is I am not calling the col1516 in this statement and having a hard time getting this to work. Can someone help me.
#237845
  • Posts: 3128
  • Karma: 105
  • Thank you received: 413

mihaela replied the topic: Concatenate Fields with IF statement

Hello,

If you wish to display an image in a list view you need to use the Image Scale plugin for that.

Setting it the way that you have tried with the if statement won't work.

You just need to put the following code in the "item Wrap Column":
${CBImageScale width: 20px;}

This way images will be displayed if uploaded. If not, no image will appear.

Let me know whether that solution is ok for you.

Regards,

Mihaela
#237847
Moderators: ForumSupport
Time to create page: 0.040 seconds

We Are Doing Our Part

Massive discounts on all of our extension subscription plans to help you and your business in these times.

Get Your Subscription Here

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

We are doing our part and support your business with extremely low prices -- For example 6-Months-Subscription for only $9 USD. For as long as necessary.

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

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!